dbTalk Databases Forums  

Outputing in T-SQL

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Outputing in T-SQL in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Paul Bull
 
Posts: n/a

Default Outputing in T-SQL - 07-08-2003 , 04:26 AM






Is there anyway of programmatically outputting the results from a select
query straight out to a file.

I am looking for a purely programmatic way that runs automated and not
through job scheduling etc.

Kind Regards



Reply With Quote
  #2  
Old   
Richard Ding
 
Posts: n/a

Default Re: Outputing in T-SQL - 07-08-2003 , 04:47 PM






Paul,

You can use -osql or -isql command (see BOL for more details):

exec master..xp_cmdshell 'osql -E -Q"select * from table" -o"C:\output.txt"
'



Richard

"Paul Bull" <bull53 (AT) bull53 (DOT) karoo.co.uk> wrote

Quote:
Is there anyway of programmatically outputting the results from a select
query straight out to a file.

I am looking for a purely programmatic way that runs automated and not
through job scheduling etc.

Kind Regards





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.