I have a script: myscript.sql
that contains a simple command: select * from mytable;
How can I modify the script to output the results onto a text file?
For example: Oracle uses the command: SPOOL C:\OUTPUT.LOG
Is there a similar way for SQLServer?
I have tried using the BCP utility as follows:
bcp mydb.user1.mytable out c:\output.log -i myscript.sql -S myserver -T
But the result is:
Invalid prefix length. Valid prefix-lengths are 0, 1, 2, or 4.
So I am looking at an alternative way to initiate the output from my sql
script rather than from the bcp command utility.
I would appreciate your help.
Thanks in advance,
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!