Tuesday, June 3, 2008

SQL Server : Issue with OSQL.EXE when input file is more than 12 mb

My little experience with OSQL is very annoying especially when I gave a file of more than 10 mb as a input file.

The i/p file has just set of stored procedures with drop command to drop the proc if it exists then to create the proc. But, interestingly OSQL has dropped and recreated many procedure but failed to drop one particular proc but tried to create the new one and hence the issue.

I spent several hours goggling on Google to get the data around any internal buffer limit on OSQL but ended with no luck. But able to get rid of the error by changing the order of the procedures. Frankly I don't know why it is working but hoping for it to continue to work.

Script to execute a script with OSQL:-
C:\Program Files\Microsoft SQL Server\90\Tools\Binn>OSQL -n -S <> -U sa -P <> -d <> -i NewProcedures.sql -o Output.txt

No comments: