December 3, 2007 at 4:47 am
How can take output of select statement to a file.
say
select * from MyTable TO c:\MyFile.txt
December 3, 2007 at 5:19 am
The easiest way is to use a DTS which in itself is a fairly large area of knowledge but the task you want should be fairly straight forward. Lots of resources are available... try this as a starting point:
http://www.devarticles.com/c/a/ASP/Creating-DTS-Packages-With-SQL-Server-2000/
December 3, 2007 at 5:35 am
EXEC master..xp_cmdshell 'osql.exe -S YourServerName -U sa -P secretcode -Q "EXEC sp_who2" -o "E:\output.txt"'
Or
You can use DTS
December 3, 2007 at 2:36 pm
Another very useful thing is BCP utility.
Look in BOL for complete description.
_____________
Code for TallyGenerator
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply