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.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Any idea's why BCP will not work?

Author  Topic 

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2010-03-25 : 22:45:59
EXEC spproductionDB.dbo.sp_configure 'show advanced options', 1
RECONFIGURE
EXEC SPProductionDB.dbo.sp_configure 'xp_cmdshell', 1
RECONFIGURE

declare @mystr varchar(200)
set @mystr = 'BCP "Select * from master..sysobjects" queryout c:\sysobjects.txt -T –S' + @@Servername
exec master..xp_cmdshell @Mystr

--I am getting the following error
/*
Unknown argument 'ûmyserver\SQLEXPRESS' on command line.
NULL
--I do not know why I can not get BCP to work... Am I missing something?
--THANKS!
*/


Success is 10% Intelligence, 70% Determination, and 22% Stupidity.
\_/ _/ _/\_/ _/\_/ _/ _/- 881

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-03-25 : 23:11:06
the dash "-" before the -S' + @@Servername is not really a dash

see


select substring(@mystr, 70, 1), ascii(substring(@mystr, 70, 1)), ascii('-')




KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2010-03-26 : 00:37:46
Nice catch... That's what I get for copying and pasting my code from the internet:)


Success is 10% Intelligence, 70% Determination, and 22% Stupidity.
\_/ _/ _/\_/ _/\_/ _/ _/- 881
Go to Top of Page
   

- Advertisement -