January 13, 2004 at 6:33 am
Hi
I am importing iis log file in to a table for some reporting purpose. I am doing it manually at the moment.
Please can anybody let me know any way i can make it automatic so that i can pass logfile name and path to a stored procedure or package to this automatically.
Thanks
Sridhar
January 13, 2004 at 8:16 am
You can pass in the parameters to a stored procedure, use the parameters to build a call to the bcp utility and then use xp_cmdshell to execute the bcp task.
January 13, 2004 at 8:38 am
http://www.iisfaq.com/default.aspx?View=A486&P=141 might be of interest to you
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
January 13, 2004 at 8:43 am
Never see them, but does iss log file have some structure? Are separated in columns?
If not, can use a DOS command like more with xp_cmdshell to read the file and insert it into a SQL table.
CREATE TABLE #iss_LogFile (Log VARCHAR(8000))
GO
INSERT INTO #iss_LogFile
EXEC master.dbo.xp_cmdshell 'more PathtoFile'
GO
SELECT * FROM #iss_Logfile
January 13, 2004 at 9:10 am
Thanks for all replys
Frank
Thank you very much for that link. It is very usefull for me.
January 14, 2004 at 1:02 am
I suggest another solution if you are interrested. If you want import iis log files to sql server database - ok, but when you must import for example 1 GB log files per day I suggest Log Parser 2.0. It's Microsoft tool and the most important thing it's free (I was reading license 6 months ago). You can analyze iis files using sql commands and export aggregates to sql server database via DSN. It's very fast !!, flexible and in my opinion great tool. But of course - your choice.
Best regards,
Gregory
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply