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 |
|
kidaduo
Starting Member
45 Posts |
Posted - 2008-01-11 : 08:53:18
|
| Hellow,I'm new in PCP utilities-- I hope someone will help me. I need to export data from SQL 2000 into my c drive. -----------------------------------------script:bcp MYDATABASE.dbo.TUDATA OUT[C : / TUDATA.TXT] - S MYSERVERNAME - U %USA % - P % 123% - W - T------------------------------------ERROR:LINE 1: Incorrect syntax near '.'.Thank uJosephine |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-01-11 : 09:03:40
|
| bcp "MYDATABASE.dbo.TUDATA" OUT "C:/TUDATA.TXT" -S "MYSERVERNAME" -U "USA" -P "123" -W -THarsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
kidaduo
Starting Member
45 Posts |
Posted - 2008-01-11 : 09:09:16
|
Thank you Harsh,Your suggestion produce the following error: "CANNOT US THE OUTPUT OPTION WHEN PASSING A CONSTANT TO A STORED PROCEDURE"Any idea?????Thkquote: Originally posted by harsh_athalye bcp "MYDATABASE.dbo.TUDATA" OUT "C:/TUDATA.TXT" -S "MYSERVERNAME" -U "USA" -P "123" -W -THarsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"
Josephine |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-01-11 : 09:14:00
|
| Is TUDATA a stored procedure?Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
kidaduo
Starting Member
45 Posts |
Posted - 2008-01-11 : 09:20:07
|
Harsh,TUDATA is a table. I'm running using qry analyzer-- may be I'm running from the wrong araea.Thkquote: Originally posted by harsh_athalye Is TUDATA a stored procedure?Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"
Josephine |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2008-01-11 : 09:21:35
|
| Looks like you are executing this as a query.It's a command line utilitymaster..xp_cmdhell bcp "MYDATABASE.dbo.TUDATA" OUT "C:/TUDATA.TXT" -S "MYSERVERNAME" -U "USA" -P "123" -W -T'But c: would be ion the server.Put the command in a .bat file or run it in a cmd window on your machine.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
kidaduo
Starting Member
45 Posts |
Posted - 2008-01-11 : 09:26:54
|
NR,I change to reflect your suggestion and is working without any issue. Thank you both of you Harsh and NR for your help.quote: Originally posted by nr Looks like you are executing this as a query.It's a command line utilitymaster..xp_cmdhell bcp "MYDATABASE.dbo.TUDATA" OUT "C:/TUDATA.TXT" -S "MYSERVERNAME" -U "USA" -P "123" -W -T'But c: would be ion the server.Put the command in a .bat file or run it in a cmd window on your machine.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy.
Josephine |
 |
|
|
|
|
|