Question
Works in Query Analyser but not in asp
I have an asp page that passes between 1 and 20 ID's in a
string to another
asp page where an Update is triggered. The string looks like:
10023567, 1000345, 90885543211
or it could be just one ID like:
27736458
My update stored procedure is:
Update Bookings
SET Status = 'Accepted'
WHERE BookingID IN (@ID)
@iD84_2 is the string mentioned above. If there is only 1 ID in the string then
the Update is performed but if there is more than 1 ID I get "cannot convert
Varchar to Int" error.
If I take the string contents and use them in Query Analyser eg.
Update Bookings
SET Status = 'Accepted'
WHERE BookingID IN (10023567, 1000345, 90885543211)
it works fine and updates the correct rows, so why do I get the error when
attempting it in an asp page?
asp page where an Update is triggered. The string looks like:
10023567, 1000345, 90885543211
or it could be just one ID like:
27736458
My update stored procedure is:
Update Bookings
SET Status = 'Accepted'
WHERE BookingID IN (@ID)
@iD84_2 is the string mentioned above. If there is only 1 ID in the string then
the Update is performed but if there is more than 1 ID I get "cannot convert
Varchar to Int" error.
If I take the string contents and use them in Query Analyser eg.
Update Bookings
SET Status = 'Accepted'
WHERE BookingID IN (10023567, 1000345, 90885543211)
it works fine and updates the correct rows, so why do I get the error when
attempting it in an asp page?
