bcp command
-
Hello, When I try the followinf in sql 2005 i get an error message: --- declare @rc varchar(8000) select @rc = 'bcp hqsqlsrvr.web_ref.dbo.anytable_USA out c:\anytable_usa.dat -c -T' exec xp_cmdshell @rc --- an error occured while processing command line. Any pointers? thanks.
-
Hello, When I try the followinf in sql 2005 i get an error message: --- declare @rc varchar(8000) select @rc = 'bcp hqsqlsrvr.web_ref.dbo.anytable_USA out c:\anytable_usa.dat -c -T' exec xp_cmdshell @rc --- an error occured while processing command line. Any pointers? thanks.
Try this one : declare @rc varchar(8000) select @rc = 'bcp "select col1, col2 from hqsqlsrvr.web_ref.dbo.anytable_USA" out c:\anytable_usa.dat -c -T' exec xp_cmdshell @rc Putting the query in double quote may solve the problem..