Hello, I#%92 m trying to use an Insert script to export data from a .csv file to a database table, but I receive errors in Query Analyzer saying that the specified column names of .csv file aren#%92 t valid, but the column names are correct.. This is the script: Use market GO INSERT INTO [SystemPerformance] ( [DateTimeCounter] ,[Total_ProcessorTime] ,[Total_processorQueueLength] ,[AvailableMbytes] ,[Pages/second] ,[Avg. Disk Queue Length] ,[Avg. Disk sec/Transfer] ,[Disk Time] ,[Network Bytes Received/sec] ,[Network Bytes Sent/sec] ,[Network Bytes Total/sec] ,[Server Bytes Received/sec] ,[Server Bytes Transmitted/sec] ,[Server Bytes Total/sec] ) SELECT [(PDH-CSV 4#0) (Pacific Standard Time)(480)] ,cast([Processor(_Total)% Processor Time] as float) ,cast([SystemProcessor Queue Length] as float) ,cast([MemoryAvailable Mbytes] as float) ,cast([MemoryPages/sec#] as float) ,cast([PhysicalDisk(_Total)Avg# Disk Queue Length] as float) ,cast([PhysicalDisk(_Total)Avg# Disk sec/Transfer] as float) ,cast([Physical Disk(_Total)% Disk Time] as float) ,cast([Network Interface(Broadcom NetXtreme Gigabit Ethernet Driver)Bytes Received/sec #] as float) ,cast([Network Interface(Broadcom NetXtreme Gigabit Ethernet Driver)Bytes Sent/sec#] as float) ,cast([Network Interface(Broadcom NetXtreme Gigabit Ethernet Driver)Bytes Total/sec#] as float) ,cast([ServerBytes Received/sec#] as float) ,cast([ServerBytes Transmitted/sec#] as float) ,cast([ServerBytes Total/sec#] as float) FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', -- csv file on a local drive 'Data Source=CerfLogs;Extended properties=Text')...System_000002#csv Which can be the problem? Thank you
Have you tried with DTS in this case? Satya SKJ Microsoft SQL Server MVP Contributing Editor & Forums Moderator http://www.SQL-Server-Performance.Com This posting is provided AS IS with no rights for the sake of knowledge sharing.