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)
 Trying to export data from a .csv file to a DB

Author  Topic 

cesark
Posting Yak Master

215 Posts

Posted - 2006-09-29 : 11:27:48
Hello,

I’ 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’ 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([\System\Processor Queue Length] as float)
,cast([\Memory\Available Mbytes] as float)
,cast([\Memory\Pages/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([\Server\Bytes Received/sec#] as float)
,cast([\Server\Bytes Transmitted/sec#] as float)
,cast([\Server\Bytes Total/sec#] as float)
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
-- csv file on a local drive
'Data Source=C:\PerfLogs;Extended properties=Text')...System_000002#csv


Which can be the problem?

Thank you

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-09-29 : 11:39:42
Why are you again posting same thing?

[url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=72754[/url]

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

cesark
Posting Yak Master

215 Posts

Posted - 2006-09-29 : 12:55:06
I'm sorry, I thought this forum was more suitable for that question
Go to Top of Page
   

- Advertisement -