1

Topic: Error. Incompatibility of data types.

I try to create stored procedure
CREATE PROCEDURE [dbo]. [sp_CreateBrand]
@brand varchar (20);
@idBrand uniqueidentifier out
AS
INSERT INTO tblBrand (idBrand, brand)
VALUES (NEWID (), @brand)
SET @idBrand=SCOPE_IDENTITY ()
GO
Produces an error since SCOPE_IDENTITY () returns numeric. How to return uniqueidentifier?

2

Re: Error. Incompatibility of data types.

CREATE PROCEDURE [dbo]. [sp_CreateBrand]
@brand varchar (20);
@idBrand uniqueidentifier out
AS
SET @idBrand=NEWID ()
INSERT INTO tblBrand (idBrand, brand)
VALUES (@idBrand, @brand)

3

Re: Error. Incompatibility of data types.

Yasha123;
Thanks