November 4, 2009 at 6:14 pm
Hi,
I created a shell script (Windows XP) that runs a stored procedure (SQL-2005) using OSQL ... and directs output to a file. The problem is that the file is text format and all fields are jammed into one line. Is there a way to output the data into a readable format, like excel?
Thanks
November 4, 2009 at 9:29 pm
Did You try SSIS?
November 4, 2009 at 10:20 pm
alark (11/4/2009)
Hi,I created a shell script (Windows XP) that runs a stored procedure (SQL-2005) using OSQL ... and directs output to a file. The problem is that the file is text format and all fields are jammed into one line. Is there a way to output the data into a readable format, like excel?
Thanks
Tell OSQL to use a TAB as a delimiter and Excel will have no problem opening the file.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 5, 2009 at 2:32 pm
Thank you Jeff, this is exactly what I needed. It worked just fine. Unfortunately I can not use SSIS because the scripts should reside off the SQL server.
November 5, 2009 at 9:04 pm
Glad I could help. As a side bar, I pretty much refuse to use SSIS for any form of ETL...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 6, 2009 at 3:33 pm
Since this is SQL Server 2005, you should be using SQLCMD vs. OSQL. OSQL is obsolete
November 6, 2009 at 4:53 pm
Thank you. I've changed it to SQLCMD and even found a new option -W to make the output to look better
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply