Hello,
I have been assigned a task to take log files from the web server that have been converted using a program called
preplog.exe that Microsoft gives gives when you are trying to analyize the log files. It apparently converts the logs into a text file that you should be able to bulk insert
into a database that you create on a sql server. I was
able to create the database no problem, it even gives you
a script to create the tables. However, in looking at the
file the fields are different from the script they give you to generate the fields. I then looked at the raw text and the database fields and changed them to match. However, when I perform the bulk insert I get an error that it cannot locate the file. The following is the script that was given to me.
CREATE TABLE [dbo].[tablename] (
[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
)
Any assistance would be greatly appreciated.![[morning] [morning] [morning]](/data/assets/smilies/morning.gif)
I have been assigned a task to take log files from the web server that have been converted using a program called
preplog.exe that Microsoft gives gives when you are trying to analyize the log files. It apparently converts the logs into a text file that you should be able to bulk insert
into a database that you create on a sql server. I was
able to create the database no problem, it even gives you
a script to create the tables. However, in looking at the
file the fields are different from the script they give you to generate the fields. I then looked at the raw text and the database fields and changed them to match. However, when I perform the bulk insert I get an error that it cannot locate the file. The following is the script that was given to me.
CREATE TABLE [dbo].[tablename] (
[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
)
Any assistance would be greatly appreciated.
![[morning] [morning] [morning]](/data/assets/smilies/morning.gif)