Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

BCP Query returns NULL result

$
0
0

I have a single client server (first of 43) who have something misconfigured apparently that prevents simple bcp query to execute. The query doesn't return errors as I have seen when security is an issue, the query result when executed from SSMS 2008 R2 (note server also has 2005 instance installed for different vendor) I only get a single row result of NULL.

declare @path varchar(8000), @bcpcommand varchar(8000)

 

set @path = 'c:\temp\dor_cuv.csv'

set @bcpcommand = ' bcp "select reasoncode, reason from mcduffie13.dbo.reason" queryout "c:\temp\dor_cuv.txt" -T -c -t "," -S "atthomas-pc\sqlexpress" '

exec master..xp_cmdshell @bcpcommand 

Interestingly, if I provide BCP with an absolute path to the folder location of the bcp.exe tool, the command executes perfectly. Ideas? Suggestions?



Tracy Thomas Georgia, USA


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>