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