Hello,
I wrote a stored procedure to experiment with returning an identity value to some ADO.NET code. The procedure and the code work fine. Here's is the procedure:
Code:
CREATE PROCEDURE procIdentityInsert
@ID int OUTPUT,
@CategoryName varchar(50)
)
AS
INSERT INTO identitytable
(CategoryName)
VALUES
(@CategoryName)
SET @ID = SCOPE_IDENTITY()
How can I use the PRINT staement in SQL Express 2005 to test this procedure? I tried:
Code:
DECLARE @ID int
EXEC procIdentityInsert @ID OUTPUT, 'Category 5'
PRINT 'ID: ' + @ID
the insert works, but I get the error:
(1 row(s) affected)
Msg 245, Level 16, State 1, Line 3
Conversion failed when converting the varchar value 'ID: ' to data type int.
Do I have to convet the int to s atring or something?
Thanks,
Bob