Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<pre>Hi,
DBNAME represents - server name
The following is sql statement 
set @sql = 'bcp xxxxx.dbo.CsvTemp out D:/EDI/INCOMING/test1.csv  -c -t, -T -SDBNAME'
which is part of a stored procedure SP1.
When i call this SP1 from .net website... BCP utility just creates the file at the location , doesnot write anything to it and holds the file forever. 
when i run it from SQL management server.. It works fine... 

Really stuck... 
don't know what to do...
Thanks
Shweta


What I have tried:

set @sql = 'bcp xxxxx.dbo.CsvTemp out D:/EDI/INCOMING/test1.csv  -c -t, -T -SDBNAME'
Posted
Comments
Richard MacCutchan 13-Feb-20 4:30am    
Since we have no idea what your stored procedure or the bcp utility do, it is impossible to give any suggestion.
Richard Deeming 13-Feb-20 8:04am    
Sounds like a permissions issue. Does the user your website is connecting as have SELECT permission on the CsvTemp table?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900