May 19, 2008 at 11:29 am
I have a batch file which does the following:
1. Uses the isql utility to executes a stored procedure which extracts some data and stores it in a table.
2. Uses the isql utility again to read data from this table using a SELECT statement and outputs the result to a text file.
My problem is that a blank line is included at the end of this file. I am using SQL Server 2000.
Is there any way to remove this extra blank line from this file?
I was getting two blank lines initially. I used the following code and now am left with one blank line
@Echo OFF
for /F "tokens=* delims=" %%G in (C:\TempInput.txt) do @echo %%G >> C:\TempOutput.txt
May 19, 2008 at 11:49 am
May 20, 2008 at 11:57 am
[font="Arial"]
Hello,
You should be using the bcp utility to output the data from the table built by the isql programming.
Regards,
Terry
[/font]
May 20, 2008 at 6:45 pm
You really shouldn't use ISQL.exe... use OSQL.exe instead. Also, as suggested, BCP is likely the way to go here.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy