I have a Windows Scripting Host (VBScript) script running on my server
updating a SQL 6.5 database. This job runs daily, generally with no
problem. We had a case where it ran and recieved the following error:
2147217900 [Microsoft][ODBC SQL Server Driver][SQL Server]INSERT statement
conflicted with COLUMN FOREIGN KEY constraint 'tblLetterFormDetails_FK01'.
The conflict occurred in database 'Pentamark', table 'tblPackages', column
'intPackageID'
Upon checking the data, it appeared that the foreign condition had been
satisfied and the error message as incorrect. We resubmitted the job 3
times and got the same error. On the fourth try (with no code or data
changes) the job ran successfully.
Can anyone think of a reason something like this might happen? Does
VBScript continue processing even if SQL Server hasn't returned control yet?
In other words, if I execute an ADO command object inserting into Table1,
followed by an ADO command object inserting into Table2, will the second
insert be executed even if the first hasn't completed yet? My understanding
was that this wasn't supposed to happen and we haven't experienced this
before however, our SQL server has been under an increased load lately.
Any help or insight would be appreciated.
Thanks,
Chris Campbell