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.
Author |
Topic |
a.ashabi
Posting Yak Master
117 Posts |
Posted - 2007-11-07 : 15:30:46
|
Hi.I would like to import the pprice.csv to table test3 on test database.I've run this query:BULK INSERT test..test3 FROM 'c:\pprice.csv'WITH ( FIRSTROW = 2, MAXERRORS = 0, FIELDTERMINATOR = ',', ROWTERMINATOR = '\t\n' )It has no error.but 0 rows effected.it means doesnt work correct.what should I do?thanks.Amen |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-11-07 : 15:36:55
|
Does c:\pprice.csv exist on the database server or just on your client machine?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-11-07 : 16:05:10
|
moved from script library_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
a.ashabi
Posting Yak Master
117 Posts |
Posted - 2007-11-07 : 16:15:59
|
The csv file is not on the database server.it's on the c drive on the server machine. |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-11-07 : 16:21:47
|
That's the problem then. BULK INSERT runs from the perspective of the database server. So your path and file must be one that the database server understands. If it's a remote file, then you must use a UNC path or mapped network drive.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
a.ashabi
Posting Yak Master
117 Posts |
Posted - 2007-11-11 : 13:39:29
|
thank u Tara.u are a big help. |
 |
|
|
|
|