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 |
|
sanlen
Starting Member
29 Posts |
Posted - 2008-11-20 : 03:02:31
|
| Hi All,i want to import data from table test12 of the database test into the text file and i tried the following statement:bcp test.dbo.test12 out test.txt -c -Usa -Seng-kimsanI got the belove error:Msg 102, Level 15, State 1, Line 1Incorrect syntax near '.'.could you please advise? thanks you very much for your time and any consideration you may give me.Best Regard,SANLEN |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-20 : 03:07:46
|
| http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/bcp-export-data-to-text-file.aspx |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-20 : 04:10:40
|
quote: Originally posted by sanlen Hi All,i want to import data from table test12 of the database test into the text file and i tried the following statement:bcp test.dbo.test12 out test.txt -c -Usa -Seng-kimsanI got the belove error:Msg 102, Level 15, State 1, Line 1Incorrect syntax near '.'.could you please advise? thanks you very much for your time and any consideration you may give me.Best Regard,SANLEN
This is syntax to do in command propmtTo run thru Query Analyser, use the method described at above linkMadhivananFailing to plan is Planning to fail |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-11-20 : 04:15:04
|
exec master..xp_cmdshell 'bcp "test.dbo.test12" out "test.txt" -c -Usa -Seng-kimsan'Just remember that the file path is relative to SQL Server, not your local query window. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
|
|
|