upload to database error from ASP
am 08.06.2006 22:19:45 von Rahul ChatterjeeHello All
I have a web page which reads in a csv/fixed width file and builds an XML
DOM which gets parsed and uploaded into a database.
Below is the stored proc which does the upload into the database. The file
is read in by the asp page and the string is built. This program works fine
for small files but for larger files it breaks. Example:
When the user created a text file fixed width with trailing spaces in the
data, I could upload only 360 records (even though my database or the asp
page has no limit on it). Every time I tried to go past 360, the page would
display an error (internal server error). When I stripped out the trailing
and leading spaces, I was able to load past the 360th record or if I broke
down the file into small pieces (with the trailing and leading spaces) I
could upload it.
Is there a limitation imposed by either ASP or XML where in we cannot create
an XML upload record past a certain size
Please advise
Thanks
DECLARE @idoc int
EXEC sp_XML_preparedocument @idoc OUTPUT, @doc
INSERT INTO TBLDATAUPLOADtemp (GROUPID, CONTRNUM, SECID, SSN,LASTNAME,
FIRSTNAME,MI,HRSWK, HRSPD , GROSS , MISC1, MISC2, MISC3, MISC4, WRKDT,
INSDATE,DISPORD)
SELECT GROUPID, CONTRNUM, SECID, SSN, LASTNAME, FIRSTNAME,MI,HRSWK, HRSPD ,
GROSS , MISC1, MISC2, MISC3, MISC4, WRKDT, CONVERT(VARCHAR,getDate()
,101),DISPORD
FROM OPENXML(@idoc,'CONTRACTOR/LINEITEM',1)
WITH (GROUPID int,
CONTRNUM char(9),
SECID char(9),
SSN char(9),
LASTNAME char(30),
FIRSTNAME char(20),
MI char(1),
HRSWK decimal(9,2),
HRSPD decimal(9,2),
GROSS decimal(9,2),
MISC1 decimal(9,2),
MISC2 decimal(9,2),
MISC3 decimal(9,2),
MISC4 decimal(9,2),
WRKDT datetime,
INSDATE datetime,
DISPORD int)