GUID - VB & Stored Procedures
Posted on 2002-03-28
I have a SQL 2000 SP2 stored procedure which accepts a parameter of type 'uniqueidentifier', which I want to use to update a GUID.
Yes I do want to update a GUID directly with a specific value.
I pass a parameter from VB as follows:
.Append DB_Command.CreateParameter("@GUID_6", adGUID, adParamInput, , pmGUID)
Where pmGUID is a VARIANT.
Inside my proc I want to test the GUID first.
If a GUID is not passed I want to do a slightly different INSERT.
In the stored proc:
Param spec looks like:
code looks like:
IF @GUID_6 IS NULL
INSERT INTO [Peals_Manager_Data].[dbo].[GUILD]
I get the following error when I try and run it:
-2147217913Operand type clash: uniqueidentifier is incompatible with int
I must have a conflict between data types in VB but for the life of me I cannot resolve it.
Any one got any code that does this please ?