<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>Search results matching tag 'SQL output target'</title><link>http://forums.iis.net/search/SearchResults.aspx?o=DateDescending&amp;tag=SQL+output+target&amp;orTags=0</link><description>Search results matching tag 'SQL output target'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Why is the SQL output target so slow?</title><link>http://forums.iis.net/p/1159904/1912939.aspx#1912939</link><pubDate>Sun, 09 Aug 2009 03:34:08 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1912939</guid><dc:creator>PWills</dc:creator><cs:applicationKey>output_targets-51</cs:applicationKey><description>Frustrated with the speed of the SQL output directives, I just ran a little experiment.

I used -o:sql to dump a log query on a 10MB IIS file. It took 2:30 (I&amp;#39;m using the COM wrapper).

I then used the &amp;quot;interactive mode&amp;quot; in COM, assembled a System.Data.DataTable by hand, and then used System.Data.SqlClient.SqlBulkCopy to bulk insert to the database. It took 18ms.

I don&amp;#39;t understand why LogParser&amp;#39;s -o:sql output directive is over 8000x slower than my crappy code. Am I doing something wrong, or is this a known issue?

I&amp;#39;m using SQL Server 2008, if that makes any difference.</description></item><item><title>Inserting higher resolution dates into SQL Server 2008 datetime2 type</title><link>http://forums.iis.net/p/1157638/1903704.aspx#1903704</link><pubDate>Thu, 14 May 2009 06:35:12 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1903704</guid><dc:creator>MikeGale</dc:creator><cs:applicationKey>output_targets-51</cs:applicationKey><description>&lt;p&gt;I have some time data in logs with a sub-second time resolution.&lt;/p&gt;
&lt;p&gt;I can get this safely into log parser using the iTsFormat setting.&lt;/p&gt;
&lt;p&gt;When I put that into SQL Server 2008 I have (so far) gotten the times in seconds (loss of resolution).&amp;nbsp; The target field is datetime2 (not datetime).&lt;/p&gt;
&lt;p&gt;How do I preserve the resolution when inserting the data?&lt;/p&gt;</description></item><item><title>Re: SQL Server Connection String That Works</title><link>http://forums.iis.net/p/1155130/1896282.aspx#1896282</link><pubDate>Wed, 11 Mar 2009 08:30:02 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1896282</guid><dc:creator>FHM786</dc:creator><cs:applicationKey>output_targets-51</cs:applicationKey><description>&lt;p&gt;&amp;nbsp;C:\Program Files\Log Parser 2.2&amp;gt;logparser -i:w3c &amp;quot;SELECT TO_LOCALTIME(TO_Timesta&lt;br /&gt;mp(REPLACE_STR(STRCAT(STRCAT(date,&amp;#39; &amp;#39;), time),&amp;#39; GMT&amp;#39;,&amp;#39;&amp;#39;),&amp;#39;yyyy-M-d h:m:s&amp;#39;)) as D&lt;br /&gt;ateTime, [Server-hostname], [Recipient-Address],[Event-ID], [total-bytes], [Numb&lt;br /&gt;er-Recipients], TO_LOCALTIME(TO_Timestamp(REPLACE_STR([Origination-time], &amp;#39; GMT&amp;#39;&lt;br /&gt;,&amp;#39;&amp;#39;),&amp;#39;yyyy-M-d h:m:s&amp;#39;)) as [Origination Time], [Message-Subject], [Sender-Addres&lt;br /&gt;s] INTO EmailLogs FROM &amp;#39;C:\20081006.log&amp;#39; where ([Event-ID] = &amp;#39;1033&amp;#39;) or ([Event-&lt;br /&gt;ID] = &amp;#39;1020&amp;#39;)&amp;quot; -o:SQL -oConnString:&amp;quot;Driver={SQL Native Client};Server=&amp;quot;dursql02&amp;quot;&lt;br /&gt;; Database=&amp;quot;MscDW&amp;quot;; Trusted_Connection=yes;username=XXXXX;password=XXXXX&amp;quot; -cre&lt;br /&gt;ateTable:ON&lt;br /&gt;&lt;b&gt;Task aborted.&lt;br /&gt;Error connecting to ODBC Server&lt;br /&gt;&amp;nbsp; SQL State:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 08001&lt;br /&gt;&amp;nbsp; Native Error:&amp;nbsp; 53&lt;br /&gt;&amp;nbsp; Error Message: [Microsoft][SQL Native Client]Named Pipes Provider: Could&lt;br /&gt;&amp;nbsp; not open a connection to SQL Server [53].&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Statistics:&lt;br /&gt;-----------&lt;br /&gt;Elements processed: 0&lt;br /&gt;Elements output:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;br /&gt;Execution time:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 16.17 seconds&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;________________________________________________________________________&lt;/p&gt;&lt;p&gt;&amp;nbsp;C:\Program Files\Log Parser 2.2&amp;gt;logparser -i:w3c &amp;quot;SELECT TO_LOCALTIME(TO_Timesta&lt;br /&gt;mp(REPLACE_STR(STRCAT(STRCAT(date,&amp;#39; &amp;#39;), time),&amp;#39; GMT&amp;#39;,&amp;#39;&amp;#39;),&amp;#39;yyyy-M-d h:m:s&amp;#39;)) as D&lt;br /&gt;ateTime, [Server-hostname], [Recipient-Address],[Event-ID], [total-bytes], [Numb&lt;br /&gt;er-Recipients], TO_LOCALTIME(TO_Timestamp(REPLACE_STR([Origination-time], &amp;#39; GMT&amp;#39;&lt;br /&gt;,&amp;#39;&amp;#39;),&amp;#39;yyyy-M-d h:m:s&amp;#39;)) as [Origination Time], [Message-Subject], [Sender-Addres&lt;br /&gt;s] INTO EmailLogs FROM &amp;#39;C:\20081006.log&amp;#39; where ([Event-ID] = &amp;#39;1033&amp;#39;) or ([Event-&lt;br /&gt;ID] = &amp;#39;1020&amp;#39;)&amp;quot; -o:SQL -oConnString:&amp;quot;Driver={SQL Native Client};Server=dursql02;&lt;br /&gt;Database=MscDW; Trusted_Connection=yes;username=XXXXX;password=XXXXX&amp;quot; -createT&lt;br /&gt;able:ON&lt;br /&gt;Task aborted.&lt;br /&gt;&lt;b&gt;An error occurred while uploading data to SQL table&lt;br /&gt;&amp;nbsp; SQL State:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 42000&lt;br /&gt;&amp;nbsp; Native Error:&amp;nbsp; 7202&lt;br /&gt;&amp;nbsp; Error Message: [Microsoft][SQL Native Client][SQL Server]Could not find&lt;br /&gt;&amp;nbsp; server &amp;#39;DURSQL02&amp;#39; in sys.servers. Verify that the correct server name was&lt;br /&gt;&amp;nbsp; specified. If necessary, execute the stored procedure sp_addlinkedserver to&lt;br /&gt;&amp;nbsp; add the server to sys.servers.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Statistics:&lt;br /&gt;-----------&lt;br /&gt;Elements processed: 426&lt;br /&gt;Elements output:&amp;nbsp;&amp;nbsp;&amp;nbsp; 80&lt;br /&gt;Execution time:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.34 seconds&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C:\Program Files\Log Parser 2.2&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Please help &lt;br /&gt;&lt;/p&gt;</description></item><item><title>CharIndex unavailable?</title><link>http://forums.iis.net/p/1150717/1875198.aspx#1875198</link><pubDate>Mon, 28 Jul 2008 19:33:31 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1875198</guid><dc:creator>jcAgora</dc:creator><cs:applicationKey>output_targets-51</cs:applicationKey><description>&lt;p&gt;Hi there, I tried to parse the info in &amp;quot;cs-uri-stem&amp;quot;,&lt;/p&gt;
&lt;p&gt;In &amp;quot;cs-uri-stem&amp;quot; it contain a string like &amp;quot; /Demodir/_233_demo.gif&amp;quot;&lt;/p&gt;
&lt;p&gt;I just want to parsed the &amp;quot;233&amp;quot; . So I used CharIndex.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tested in CharIndex on SQL and it worked, but once I run it in LogParser&amp;nbsp; it failed. The error message is as following:&lt;/p&gt;
&lt;p&gt;Error: Syntax Error: &amp;lt;field-expr&amp;gt;: cannot find a vaild &amp;lt;field-expre&amp;gt;:&amp;#39;CHARINDEX(&amp;#39;_&amp;#39;,&amp;#39;)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is my query:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;LOGPARSER -i:IISW3C &amp;quot;Select LogRow, time, c-ip, cs-method,cs-uri-stem,SUBSTR(cs-uri-stem, CHARINDEX(&amp;#39;_&amp;#39;, cs-uri-stem) + 1, (CHARINDEX(&amp;#39;_&amp;#39;, cs-uri-stem,CHARINDEX(&amp;#39;_&amp;#39;, cs-uri-stem) + 1) - CHARINDEX(&amp;#39;_&amp;#39;, cs-uri-stem) - 1)) as ContentId&lt;br /&gt;&amp;nbsp; from C:\WINDOWS\system32\Logfiles\W3SVC1\ex080725.log where cs-uri-stem Like &amp;#39;/DemoWeb/Images/Up/EML/%&amp;#39;&amp;quot; -o:datagrid&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;any suggestion is welcome.&lt;/p&gt;
&lt;p&gt;Thanks in advanced,&lt;/p&gt;
&lt;p&gt;---Joe&amp;nbsp;&lt;/p&gt;</description></item><item><title>Connecting to Oracle XE from Log Parser 2.0</title><link>http://forums.iis.net/p/1150006/1872284.aspx#1872284</link><pubDate>Fri, 20 Jun 2008 22:13:22 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1872284</guid><dc:creator>NathanBlakley</dc:creator><cs:applicationKey>output_targets-51</cs:applicationKey><description>&lt;p&gt;Hi, I am having trouble connecting to Oracle XE to import IIS logs. Each time that I try a variation on (some names changed to protect the innocent):&lt;/p&gt;&lt;p&gt;LogParser.exe -i:IISW3C file:iislogquery.sql?logpath=&amp;quot;V:\\Logfiles\\XYZ&amp;quot; -o:SQL -oConnString:&amp;quot;Driver={Oracle in Home_Default10g};DBQ=111.111.111.111:1521/XE;Uid=mydw;Pwd=mypswd&amp;quot;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The following error is presented:&lt;/p&gt;&lt;p&gt;Task aborted.&lt;br /&gt;Error connecting to ODBC Server&lt;br /&gt;&amp;nbsp; SQL State:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IM002&lt;br /&gt;&amp;nbsp; Native Error:&amp;nbsp; 0&lt;br /&gt;&amp;nbsp; Error Message: [Microsoft][ODBC Driver Manager] Data source name not found&lt;br /&gt;&amp;nbsp; and no default driver specified&lt;/p&gt;&lt;p&gt;Attempts to sent to a CSV have been successful. The switch to SQL seems to break. Any ideas of what I am doing wrong?&lt;br /&gt;Many thanks.&lt;/p&gt;&lt;p&gt;Nathan&amp;nbsp;&lt;/p&gt;</description></item><item><title>Output SQL Error Log to SQL Database Table</title><link>http://forums.iis.net/p/1149428/1869817.aspx#1869817</link><pubDate>Mon, 19 May 2008 19:17:34 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1869817</guid><dc:creator>modemgeek</dc:creator><cs:applicationKey>output_targets-51</cs:applicationKey><description>&lt;p&gt;I&amp;#39;m having problems exporting the log to a SQL database.&amp;nbsp; The errors I seem to get are related to the field name/data type.&amp;nbsp; I ran the following below to get the field names.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;LogParser &amp;quot;select * INTO C:\log.txt From &amp;#39;C:\Program Files\Microsoft&lt;br /&gt;SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG&amp;#39;&amp;quot; -i:TSV -o:TSV -headerrow:off&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This is what it returns:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Filename&amp;nbsp;RowNumber&amp;nbsp;Field1&lt;br /&gt;C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG&amp;nbsp;1&amp;nbsp;2008-05-11 22:58:21.48 Server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)&lt;br /&gt;C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG&amp;nbsp;2&amp;nbsp;Oct 14 2005 00:33:37&lt;br /&gt;C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG&amp;nbsp;3&amp;nbsp;Copyright (c) 1988-2005 Microsoft Corporation&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;It appears that the only fields are filename, rownumber, and field1.&amp;nbsp; How do I address the date field, source, and message field?&lt;/p&gt;
&lt;p&gt;I can output to a text file with no problem, but with into SQL server I keep getting errors.&amp;nbsp; If I use the iHeaderFile parameter, what do I put in the text file?&amp;nbsp; This is what I have so far.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;LogParser &amp;quot;select STRCAT(STRCAT(DATE,&amp;#39; &amp;#39;), TIME) as LogDateTime, SOURCE, Message INTO SQLEvents2 From &amp;#39;C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG&amp;#39;&amp;quot; -i:TSV -iseparator:spaces -iHeaderFile:c:\scripts\sqleventsformatfile.txt -headerRow:OFF -nskiplines:9 -o:SQL -server:xxxx -database:Events -driver:&amp;quot;SQL Server&amp;quot; -username:xxxx -password:xxxx -createTable:ON&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>SQL Output : Why &amp;quot;Select * [...]&amp;quot; before inserting ? --&amp;gt; Memory pb with big database</title><link>http://forums.iis.net/p/1147832/1862993.aspx#1862993</link><pubDate>Sat, 02 Feb 2008 18:27:56 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1862993</guid><dc:creator>Hoplebus</dc:creator><cs:applicationKey>output_targets-51</cs:applicationKey><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m a long time LP user and I&amp;#39;m faced with a strange behaviour when outputing to SQL.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using LP v2.2, Mysql v5.1 and MySQL ODBC Connector v3.51.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m uploading parsed results to a MySQL DB.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The destination table&amp;nbsp;already contains ~1GB of data.&lt;/p&gt;
&lt;p&gt;When LP finishes parsing and just before&amp;nbsp;uploading recordsets to the DB, it looks like it first issues a &amp;quot;Select * from OutputTable&amp;quot;&lt;/p&gt;
&lt;p&gt;--&amp;gt; memory&amp;nbsp;consuption explodes&amp;nbsp;and LP exists (in fact the error message comes from the ODBC connector) with an &amp;quot;out of memory error&amp;quot;.&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;diagnosed the &amp;quot;Select *&amp;quot; query by setting up &amp;quot;Tracing&amp;quot; in&amp;nbsp;Windows ODBC administrative pannel and analysing the SQL.log file. I too can see this query on the server side.&lt;/p&gt;
&lt;p&gt;The params of the SQL output are :&lt;/p&gt;
&lt;p&gt;createTable :&amp;nbsp;off&lt;/p&gt;
&lt;p&gt;clearTable :&amp;nbsp;off&lt;/p&gt;
&lt;p&gt;I tried to play around with the other SQL output params without success.&lt;/p&gt;
&lt;p&gt;I see no obvious need to launch such a query before issuing the Inserts.&lt;/p&gt;
&lt;p&gt;I have&amp;nbsp;2 workarounds that consists in :&lt;/p&gt;
&lt;p&gt;-&amp;nbsp;getting the recordsets from LP and issuing myself the Inserts using ADO, but as I&amp;#39;m using VBScripts, I imagine that&amp;nbsp;performance will be very poor and my script will have to keep the parsed result in memory before uploading it to the DB.&lt;/p&gt;
&lt;p&gt;- output a TSV file (tab separator) and issue a &amp;quot;&lt;font face="Courier New"&gt;LOAD DATA INFILE&amp;quot;&lt;/font&gt;&amp;nbsp;to bulk load it into Mysql, but this is more complex and&amp;nbsp;not portable at all...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In fact, I don&amp;#39;t know if it&amp;#39;s LP who is explicitly issuing the &amp;quot;Select *&amp;quot; query or if it is generated by the Mysql Connector.&lt;/p&gt;
&lt;p&gt;Could anyone &amp;quot;debug&amp;quot;, say, LP inserting into SQL Server to see if it exhibits the same behaviour ?&lt;/p&gt;
&lt;p&gt;Has anybody an idea on how to solve that issue ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks in advance !&lt;/p&gt;</description></item><item><title>Re: Auto-increment primary key in SQL tables</title><link>http://forums.iis.net/p/1146696/1858655.aspx#1858655</link><pubDate>Thu, 01 Nov 2007 17:08:57 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1858655</guid><dc:creator>gian.laurenzi</dc:creator><cs:applicationKey>output_targets-51</cs:applicationKey><description>&lt;p&gt;Thank you, but this is another problem related to create a new SQL table!&lt;/p&gt;&lt;p&gt;Please somebody help me, how can i create a SQL table with an auto-increment (IDENTITY(1,1)) primary key, a datetime field and others text fields?&lt;/p&gt;&lt;p&gt;I have some logs (from router/firewall) with this format:&lt;/p&gt;&lt;p&gt;&amp;nbsp;SourceAddress ; SendTime ; Facility ; Severity ; MessageText&lt;/p&gt;&lt;p&gt;192.168.1.1; 01/11/2007 18.00.00; local7; Alert; Some text...&lt;/p&gt;&lt;p&gt;I want to create a SQL table (I&amp;#39;m using SQL Server 2005 Express Edition) using this query:&lt;/p&gt;&lt;p&gt;SELECT 1, TO_TIMESTAMP (SendTime, &amp;#39;dd/MM/YYYY?hh.mm.ss&amp;#39; ) AS Send_Time, Facility, Severity, MessageText&lt;br /&gt;INTO [ IPADDRESS ]&lt;br /&gt;FROM &amp;#39;LogFile_*.csv&amp;#39;&lt;br /&gt;WHERE SourceAddress = &amp;#39;IPADDRESS&amp;#39; (note that IPADDRESS is a variable) &lt;/p&gt;&lt;p&gt;quite easy, isn&amp;#39;t?&lt;/p&gt;&lt;p&gt;But I encountered several problems:&lt;/p&gt;&lt;p&gt;I am unable to create an auto-increment primary key.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I am unable to create a datetime field with the function TO_TIMESTAMP (note that i use italian date format), without the TO_TIMESTAMP it creates a String field.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Please help me!!&lt;/p&gt;&lt;p&gt;Thanks in advance!&amp;nbsp;&lt;/p&gt;</description></item><item><title>Auto-increment primary key in SQL tables</title><link>http://forums.iis.net/p/1146696/1858160.aspx#1858160</link><pubDate>Mon, 22 Oct 2007 11:07:20 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1858160</guid><dc:creator>gian.laurenzi</dc:creator><cs:applicationKey>output_targets-51</cs:applicationKey><description>&lt;p&gt;&amp;nbsp;Hello, I&amp;#39;m trying to create and populate some SQL Tables from log file using LogParser COM API.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I use SQL Output format with -createTable option enabled and i need an auto-generated identity column (an auto-increment primary key!)&lt;/p&gt;&lt;p&gt;I tried&lt;/p&gt;&lt;p&gt;&lt;i&gt;SELECT 1, SendTime, Facility, Severity, MessageText ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; INTO [&amp;quot; + IPAdd.ToString() + &amp;quot;] &amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FROM &amp;#39;&amp;quot; logfile + &amp;quot;&amp;#39; &amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE SourceAddress LIKE &amp;#39; &amp;quot; + IPAdd.ToString() + &amp;quot; &amp;#39;&amp;quot;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;but I obtained&lt;/p&gt;&lt;p&gt;&lt;i&gt;Error executing query: Error creating table&lt;br /&gt;SQL State:     42000&lt;br /&gt;Native Error:  102&lt;br /&gt;Error Message: [Microsoft][SQL Native Client][SQL Server]Incorrect syntax near 1.&lt;/i&gt;&lt;i&gt;&lt;br /&gt;Most
likely you&amp;#39;re attempting to create a table with invalid column names,
such as names containing the &amp;#39;-&amp;#39; character, or names that are illegal
for the database you are connecting to (e.g. &amp;#39;timestamp&amp;#39;). Rename the
columns in the SELECT clause using the AS statement. [Unknown Error]&lt;/i&gt;&lt;/p&gt;&lt;p&gt;OK! so I change my query in&lt;/p&gt;&lt;p&gt;&lt;i&gt;SELECT 1 AS LogID, SendTime, Facility, Severity, MessageText ;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; INTO [&amp;quot; + IPAdd.ToString() + &amp;quot;] &amp;quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FROM &amp;#39;&amp;quot; logfile + &amp;quot;&amp;#39; &amp;quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE SourceAddress LIKE &amp;#39; &amp;quot; + IPAdd.ToString() + &amp;quot; &amp;#39;&amp;quot; &lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;/i&gt;&lt;br /&gt;&amp;nbsp;but I always obtain 1 in the first column, when i needed an identity column!&lt;/p&gt;&lt;p&gt;As you can see in my other post, i tried to create tables at run-time with SQLCommands embedded in my C# code, but it generates another error!&lt;/p&gt;&lt;p&gt;Please help me!&lt;/p&gt;&lt;p&gt;Thanks in advance,&lt;/p&gt;&lt;p&gt;Giancarlo Laurenzi.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>SQLEXPRESS</title><link>http://forums.iis.net/p/1146050/1851262.aspx#1851262</link><pubDate>Thu, 21 Jun 2007 17:54:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1851262</guid><dc:creator>LogParser User : IanB</dc:creator><cs:applicationKey>output_targets-51</cs:applicationKey><description>&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;I am trying to import a merged W3C Extended log into a SQLEXPRESS instance.&lt;/P&gt;&lt;P&gt;My LogParser 2.2 query is as follows:&lt;/P&gt;&lt;P&gt;LogParser -i:W3C -o:SQL "SELECT date, time, s-computername, c-ip, cs-uri-stem, cs-uri-query, sc-status, sc-substatus, sc-win32-status, time-taken, sc-bytes, cs-bytes FROM MERGED_LOG.log TO W3CLogs" -driver:"SQL Server" -server:.\sqlexpress -database:IISLogs -createtable: ON -fixColNames: ON&lt;/P&gt;&lt;P&gt;I get the following error:&lt;/P&gt;&lt;P&gt;Task aborted.&lt;BR&gt;An error occurred while uploading data to SQL table&lt;BR&gt;&amp;nbsp; SQL State:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 42000&lt;BR&gt;&amp;nbsp; Native Error:&amp;nbsp; 7202&lt;BR&gt;&amp;nbsp; Error Message: [Microsoft][ODBC SQL Server Driver][SQL Server]Could not&lt;BR&gt;&amp;nbsp; find server 'IANBE-LT-M5\SQLEXPRESS' in sys.servers. Verify that the&lt;BR&gt;&amp;nbsp; correct server name was specified. If necessary, execute the stored&lt;BR&gt;&amp;nbsp; procedure sp_addlinkedserver to add the server to sys.servers.&lt;/P&gt;&lt;P&gt;Statistics:&lt;BR&gt;-----------&lt;BR&gt;Elements processed: 81&lt;BR&gt;Elements output:&amp;nbsp;&amp;nbsp;&amp;nbsp; 80&lt;BR&gt;Execution time:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.83 seconds&lt;BR&gt;&lt;/P&gt;&lt;P&gt;I see that the table is created in the database but is never populated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help you can offer would be greatly appreciated&lt;/P&gt;</description></item></channel></rss>