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
 General SQL Server Forums
 New to SQL Server Programming
 write to text file from sql

Author  Topic 

bill_
Starting Member

38 Posts

Posted - 2010-06-04 : 10:05:11
I'm being asked to write data from a stored procedure to a text file that looks like a nice report. The data consists of a few numbers and rows and columns that are in a table variable.
What is the best way to do this ?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-06-04 : 10:06:41
Have you tried bcp?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

bill_
Starting Member

38 Posts

Posted - 2010-06-04 : 10:48:08
Yes. I copied some code from a website and got error saying "the execute permission was denied on the object xp_cmdshell database mssswlsystemresources etc".

Wondering if server where sql is running has no idea about drives and directories I'm mapped to - like if I try to write to my c drive, it thinks I mean the server c drive. Don't know much about this.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-06-05 : 10:48:23
might be becasuse the surface area config was not set up to allow xp_cmdshell to be allowed execution...shouldn't have anything to do with permission to a local drive



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -