• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 474
  • Last Modified:

Writing to a text file from a stored procedure

I created this script to output the results from a stored procedure to a text file. The file is not being created.
declare @cmd varchar(1000)
select @cmd = 'osql -S xxxx -d xx  -Q"sp_help_revlogin2" -o"c:\osqloutput.txt" -w500'
exec master..xp_cmdshell @cmd

Open in new window

0
redouard
Asked:
redouard
  • 2
1 Solution
 
Anthony PerkinsCommented:
Perhaps you do not have the appropriate permissions.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
<The file is not being created.

it IS created, but on the SERVER, not on your client machine.
0
 
Anthony PerkinsCommented:
Good point.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now