Hello everyone,
I create the following table,
[Code]
create table ABC (a varchar unique);
[/Code]
then create the following store procedure,
[Code]
CREATE PROCEDURE [dbo].[prc_AddABC]
AS
BEGIN
INSERT INTO [dbo].[ABC]
values ('a');
SELECT @@ERROR AS ABCERROR;
END -- end of store procedure
[/Code]
After execute the procedure twice, which will cause insert duplicate value 'a' on unique column a error.
What I got from Management Studio is,
ABCERROR 2627
return value -4
My question is, why @@error is not the same as return value? what does the message and return value mean? Where could I find
related documents to read their meanings?
thanks in advance,
George