Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to automaticatly save a sql result to a file?

Status
Not open for further replies.

kenworld

Technical User
Joined
Aug 4, 2001
Messages
3
Location
US
Example:

Select * from TEST_TBL
result are saved to a file called text
c:\test.txt
 
Try this

declare @str varchar(100)
select @str = 'isql -Q "set nocount on
SELECT * from TEST_TBL" -o\\test.txt'
exec master..xp_cmdshell @str

also have a look at the many params of isql

enjoy..............
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top