September 30, 2013 at 11:31 am
I have verified that the user has local admin privileges; execute on master and equote databases.
The first Directory xp_cmdshell creates the test6.txt file perfectly.
The second bcp xp_cmdshell statement returns 128 in @rc and does nothing else that I know of.
I have been working on various scenarios for days. Any help would be appreciated.
set nocount on
declare @cmd varchar(255),
@rc int
exec master..xp_cmdshell '"dir c:\*.* > C:\temp\test6.txt"'
set @cmd = 'bcp "select * from equote.dbo.Country" queryout "C:\temp\test6b.txt" -c, -t, -d equote, -S Spidertel10' -- DOES NOT WORK
select * from equote.dbo.Country
exec @rc = master..xp_cmdshell @cmd
print 'cmd: ' + @cmd
print @rc
Grid Output: Null, correct list of Countries, Null
Messages:
cmd: bcp "select * from equote.dbo.Country" queryout "C:\temp\test6b.txt" -c, -t, -d equote, -S Spidertel10
128
Viewing post 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy