Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 what is the value of error

Author  Topic 

Hippi
Yak Posting Veteran

63 Posts

Posted - 2004-11-20 : 02:48:46
Today I was asked the following question but I don't know the answer. Could you guys tell me the answer and explain why?

CREATE PROC TestProc
@I int OUTPUT
AS
SET @I=1
RAISERROR ('An error',18,50)
SET @I=@@ERROR
go

DECLARE @I int
EXEC TestProc1 @I=@I OUTPUT
select @I
go

I don't have computer to test.
Thanks a bunch.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-11-22 : 14:17:33
What do you want us to explain? If you don't have a computer to test this out on, then why are you asking the question? Is this an interview question?

Tara
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-11-22 : 14:24:21
Since you don't create testproc1, I'd say nothing happens except the creation of testproc...

And if you did fix it, you'd get



Server: Msg 50000, Level 18, State 50, Procedure TestProc, Line 5
An error

-----------
50000




Brett

8-)
Go to Top of Page
   

- Advertisement -