user1706965
user1706965

Reputation: 1

Use xp_cmdshell and bcp utility not working

Running these on SQL server 2014 SP3

EXEC master..xp_cmdshell 'dir c:\' -- This is working

** The following is on a single row **

EXEC master..xp_cmdshell 'bcp "select name, type_desc, create_date from sys.objects" queryout "c:\bcptest2.txt" -T -Sbl3c0b\switch2014 -c -t,' --This is not working

I ran the bcp from the command prompt successfully but from using xp_cmdshell it is not working at all.

I ran the following already

EXEC master.dbo.sp_configure 'show advanced options', 1

RECONFIGURE

EXEC master.dbo.sp_configure 'xp_cmdshell', 1

RECONFIGURE

Thanks!

Upvotes: 0

Views: 514

Answers (1)

user1706965
user1706965

Reputation: 1

From home on VPN it was not working but when I got to my company work space network, it worked.

I don't know why but at least it is working as expected.

Upvotes: 0

Related Questions