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 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply