I wanted to have a job schedule inside MS SQL 2008 server that will print the txt file exported. Can this be done? What will be a syntax, sorry I don't know where to start to.
Txt File Print in SQL
Collapse
X
-
Thank you Rabbit.
To make it work I created a procedure that will extract the data into text file and I created this scheduled batch file to print the file.
Now, my next problem is how to tell inside my sql extract to file procedure to print it in new page for each record. See my code below. I use the combination of CHAR(13) + CHAR(10)
to go to the next line. What about page break or new page? Is there an ascii code that will tell to go to the next page?
Code:DECLARE @NewLineChar AS CHAR(2) = CHAR(13) + CHAR(10) SELECT 'DATE:'+getdate()+ @NewLineChar +'Customer Name:'+last_name+', '+first_name + NewLineChar +'Customer Record Number:'+rec_nbr + @NewLineChar FROM Tbl_customer
Comment
Comment