Link that shows how to use the SQL Server to analyze IIS log file.
http://support.microsoft.com/kb/296085
In general:
1. Create table in the database
http://support.microsoft.com/kb/296085
In general:
1. Create table in the database
CREATE TABLE [dbo].[tablename] (2. Import log file using the bulk Insert function
[date] [datetime] NULL,
[time] [datetime] NULL ,
[c-ip] [varchar] (50) NULL ,
[cs-method] [varchar] (50) NULL ,
[cs-uri-stem] [varchar] (255) NULL ,
[cs-uri-query] [varchar] (2048) NULL ,
[sc-status] [int] NULL ,
[sc-bytes] [int] NULL ,
[time-taken] [int] NULL ,
[cs(User-Agent)] [varchar] (255) NULL ,
[cs(Cookie)] [varchar] (2048) NULL ,
[cs(Referer)] [varchar] (2048) NULL
)
BULK INSERT [dbo].[tablename] FROM 'c:\weblog.log'
WITH (
FIELDTERMINATOR = ' ',
ROWTERMINATOR = '\n'
)
Comments