Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
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 goI 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
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 5An error ----------- 50000