Re: Auto Exiting Store Procedures

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Peter (anonymous_at_discussions.microsoft.com)
Date: 02/23/04


Date: Mon, 23 Feb 2004 02:34:08 -0800

Thanks Tibor,

Could you point me to a resource that would show me what
can, and can't be done.

I have looked at BOL but with no success.

Peter

>-----Original Message-----
>For some errors, SQL Server will terminate the batch.
Such errors include
>many datatype conversion errors, references to objects
which doesn't exist
>and other "hard" errors. There is no setting for this,
I'm afraid.
>
>--
>Tibor Karaszi, SQL Server MVP
>Archive at:
>http://groups.google.com/groups?
oi=djq&as_ugroup=microsoft.public.sqlserver
>
>
>"Peter" <anonymous@discussions.microsoft.com> wrote in
message
>news:1427001c3f9f5$3edf2120$a101280a@phx.gbl...
>> I'm sorry Uri, but I don't understand your answer.
>>
>> Here is an example. The following code will always fail
as
>> it is trying to put a char in an int.
>>
>> CREATE procedure p_Test
>> as
>>
>> DECLARE @Error as int
>>
>> SET @Error = 0
>>
>> --Update the table name and all column names
>> Insert into tblText (TestInt)
>>
>> --List all the parameters in the same order as the
column
>> names
>> Values ('A')
>>
>> SET @Error = @@ERROR
>>
>> Return @Error
>> GO
>>
>>
>> So what I want to do is stop the SP exiting at the
error,
>> but continue so I can trap, and deal with it.
>>
>> Currently the SET @Error = @@ERROR doesn't happen.
>>
>> Peter
>>
>> >-----Original Message-----
>> >Peter
>> >CREATE PROC my_proc
>> >@par INT
>> >AS
>> >IF @par >1
>> >SELECT OrderID FROM Orders
>> >ELSE
>> >RETURN
>> >GO
>> >EXEC my_proc 2
>> >GO
>> >DROP PROC my_proc
>> >
>> >"Peter" <anonymous@discussions.microsoft.com> wrote in
>> message
>> >news:1504501c3f9f1$e06b5170$a601280a@phx.gbl...
>> >> Dear All,
>> >>
>> >> Is there a way of turning off the auto exiting of
store
>> >> procedures when there is an error ?
>> >>
>> >> Thanks
>> >> Peter
>> >
>> >
>> >.
>> >
>
>
>.
>



Relevant Pages

  • Re: Auto Exiting Store Procedures
    ... SQL Server will terminate the batch. ... "Peter" wrote in message ... > it is trying to put a char in an int. ... >>CREATE PROC my_proc ...
    (microsoft.public.sqlserver.programming)
  • Re: Mail Merge to SQL Server without using an external ODC
    ... but when the source changed to SQL Server it quit ... "Peter Jamieson" wrote: ... the interface) would be to distribute the *.odc file for the connection ... The distribution path you describe would require an installer, ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Word 2003/Access2000/SQLSVR
    ... SQL server being where the data is held and this is accessed through a MS ... entire database and that may be say a record for Berkshire. ... "Peter Jamieson" wrote: ... replaced with the first record on the table in use. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: OpenDataSource SQL Server xpress problem
    ... Thanks a lot Peter. ... all the examples for Access files and none for SQL Server ... Open Data Source dialog, selecting the "Microsoft SQL Server" option, then ... 'Dim strConnect = System.Type.Missing ...
    (microsoft.public.word.mailmerge.fields)
  • Re: bringing Pocket Internet Explorer (PIE) to foreground
    ... Peter Foot ... the PIE window did not come to the foreground on the ASUS ... >> Windows Embedded MVP ... >>> public static extern int FindWindow (string lpClassName, ...
    (microsoft.public.dotnet.framework.compactframework)