Advertisement

01.30.2008 at 10:15AM PST, ID: 23123697
[x]
Attachment Details

Writing to a text file from a stored procedure

Asked by redouard in MS SQL Server, SQL Query Syntax

I created this script to output the results from a stored procedure to a text file. The file is not being created.Start Free Trial
1:
2:
3:
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
[+][-]01.30.2008 at 10:23AM PST, ID: 20779489

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.30.2008 at 10:27AM PST, ID: 20779521

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL Server, SQL Query Syntax
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 2
Solution Grade: A
 
 
[+][-]01.30.2008 at 10:29AM PST, ID: 20779546

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628