I Have an SQL Server 2008 Stored Procedure for the batch creation of some order records on our system. It is rather a large procedure and performs some quite complicated statements iteratively according to the number of records you need creating.
I use the SP to read a template held on the database in a table and create the new records from it.
I set it to create 10 new records.
When I call the procedure from SQL MS with this:
@WasteBatchId = 25
It works just fine
When I call the same SP from classic ASP with ADO and the same parameter like this:
SQLStmt = "exec dbo.usp_CreateBatchRecords '25';"
Set RS_Procedure01 = Connection01.Execute(SQLStmt)
I get all sorts of spurious results.
Sometimes it only produces 6 records, sometimes 5 etc.
I am thinking some sort of timeout here, but the run time is half a second or less.
What really baffles me is that the SP is self contained. If it produces one record shouldn't it be carrying on and producing all the rest until it is done?
Anyone have any ideas where to look