Output TSQL result to textfile in script

Posted by Nev_Rahd on Stack Overflow See other posts from Stack Overflow or by Nev_Rahd
Published on 2010-03-01T00:05:29Z Indexed on 2010/03/12 8:57 UTC
Read the original article Hit count: 285

Filed under:
|

Is there a way to directly write result returned from TSQL / stored procedure to a text file (not using CTRL + T => Result to Text). As this TSQL will be dynamic in one of my service routine. Whenever I call this service routine it generates SQL Statement => executes and here I want to direct it to text file by passing the filepath as parameter.

How can this be done ?

Thanks

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about tsql