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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-09-07 : 11:57:41
|
| Javier writes "I extracted this code from you and I made some changesDECLARE @FileName varchar(50), @bcpCommand varchar(2000)SET @FILENAME = 'zz.txt'SET @bcpCommand = 'bcp "SELECT * FROM XMSDAR..Tbl_XMSDARHistory " queryout " 'SET @bcpCommand = @bcpCommand + @FileName + '" -U sa -P -c'EXEC master..xp_cmdshell @bcpCommandoutput ------------------------------------------------------------ NULLStarting copy...NULL5 rows copied.Network packet size (bytes): 4096Clock Time (ms.): total 1 Avg 0 (5000.00 rows per sec.)(6 row(s) affected)But I can not find the file zz.txtWhen I modified set @filename = 'c:\zz.txt' I got this erroroutput ------------------------------------------------------------ SQLState = S1000, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]Unable to open BCP host data-file(2 row(s) affected)Any Idea what is happening with this code??Thankyou" |
|
|
|
|
|