Link to home
Start Free TrialLog in
Avatar of redouard
redouard

asked on

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

Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Perhaps you do not have the appropriate permissions.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good point.