Out of Memory

Hi Guys,
What i'm trying here is to run a .bat file containing Osql Command's on the server using asp. Which is Generating Out Of Memory Error.

In Detail.

This .bat file is having a Osql command to connect to a database with a parameter to run a .sql file and output parameter to give to output in .txt file. This is working fine if I simply run the .bat file on the server. its working fine no probes, but when I try the same from a .asp file running this .asp file from the same machine its giving me theOut of Memory Error.


Content of the .bat file is
@cd
@osql -U user -P Password -i c:\BatchUpdateTest\test.sql -o c:\BatchUpdateTest\test.txt
@pause

Content of the .sql file is
SELECT * INTO ARC_TABLENAME TABLENAME
GO

DECLARE @del_error int
DECLARE @description VARCHAR(1000)

SELECT @del_error= @@ERROR
SELECT @description= description FROM MASTER..SYSMESSAGES WHERE error = @del_error

IF @del_error = 0
SELECT * FROM ARC_TABLENAME
ELSE
PRINT @description+' ARC_TABLENAME'
GO


Content of the .asp file is
<%
var server_shell = Server.CreateObject("wscript.shell")
try{
server_shell.Run("c:\BatchUpdateTest\test.bat",1)
}catch(e){
Response.Write(e.description)
}
%>

Actualy when i run this code in the .bat file from .asp it did not give any error. So what i did is put a try catch block to trap the error which gives me this errorOut of memory.

What should i do to solve this problem
Plz Help me out in this

Thanks in advance
Dinesh

[1790 byte] By [dadson98] at [2008-2-8]
# 1
You need to troubleshoot from ASP side. It is unlikely this has anything to do with SQL or the batch file itself.

SQL Server

Site Classified