I'm using a data driven query with a lookup query that calls the following stored procedure:
In the Lookup query section I make a call to the procedure as:
and have tested this works in Query Analyser. So in my ActiveX transformation script I then call the lookup as:
but although the procedure runs fine (the NEXT_NO table gets updated) the assignment for ITEM_ID fails. Can anyone help. The message I get is:
...encountered an invalid date value for 'ITEM_ID' destination column.
Please help. Its driving me mad!
Code:
CREATE PROCEDURE sp_getnextid (
@key CHAR(20), @next_id d_count OUTPUT )
AS
SELECT @next_id = (NEXT_NO+1) FROM NEXT_NO
WHERE NEXT_KEY = @key
UPDATE NEXT_NO SET NEXT_NO = @next_id
WHERE NEXT_KEY = @key
RETURN @next_id
GO
Code:
DECLARE @next d_count
EXEC sp_GetNextID @key = 'ITEM_ID', @next_id = @next OUTPUT
SELECT @next
Code:
Dim itemID
itemID = DTSLookups("getNextID").Execute()
' assign parameters for insert
DTSDestination("ITEM_ID") = itemID
...encountered an invalid date value for 'ITEM_ID' destination column.
Please help. Its driving me mad!