Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Bulk Insert . pLease Help .

Author  Topic 

admin001
Posting Yak Master

166 Posts

Posted - 2002-06-27 : 04:52:28

Hi ,

I have imported an NT event log file from an NT server in a test database . The table has been created automatically having the same name as the file name with 10 columns as Col001.Col002 ...and so on till Col0010 .
Now i want to copy the data of the event logs to specific columns i create . So i created a table with column names such as Evnt , date , time , server and evntdescription so that whenever i can execute a simple query like

Select * from tablename where type = 'app' , Server = 'test1 ' .

so that i get all the results for that server 'test1' with type 'application ' .

The problem is how do i insert that event log file into the table which i have created with different columns names . So that the data with 'App' should go to column 'type , data with server name should go to the column name server and so on ..

I tried all the was but could not succeed . Can i get some help in this regard please through some stored procedure or through DTS or BCP , if its possible .
The server is a SQL Server 2000 with SP1 .

Many thanks


YellowBug
Aged Yak Warrior

616 Posts

Posted - 2002-06-27 : 06:10:32
To copy the data into the new table:
INSERT NewTable (Evnt , date , time , server and evntdescription)
SELECT Col1, Col2, Col3, Col4, Col5
FROM OldTable

Or you could rename the columns of the original table, using sp_rename.

From DTS, use the Column Mappings and Transformation to achieve this.
Go to Top of Page

admin001
Posting Yak Master

166 Posts

Posted - 2002-06-27 : 07:23:11
Hi,

Extremely thanks four reply . But when i try to change the column names in the Transformations tab by selecting ' Transform Information as it is copied to the destination ' and execute it , it gives me an error in the VB script language .

Further i want to schedule this job everyday . That is the NT event log data will directly get copied in the table i have customised with new column names .

Do you have any insight on this matter please . Thanks once again for your reply.



Go to Top of Page
   

- Advertisement -