Discussion:
How to change Severity for Err 266
(too old to reply)
BuddyWork
2004-02-05 08:56:58 UTC
Permalink
Hello,

Can someone please give me an example of how I can change
the severity of 16 to severity of 10 for Err 266.

Thanks
Anthony Faull
2004-02-05 09:15:00 UTC
Permalink
EXEC sp_configure 'allow updates', '1'
RECONFIGURE WITH OVERRIDE
GO
UPDATE master.dbo.[sysmessages]
SET severity = 16
WHERE error = 266
AND severity = 10

EXEC sp_configure 'allow updates', '0'
RECONFIGURE WITH OVERRIDE
Post by BuddyWork
Hello,
Can someone please give me an example of how I can change
the severity of 16 to severity of 10 for Err 266.
Thanks
BuddyWork
2004-02-05 09:27:12 UTC
Permalink
Thanks for this information,

I've tried this and each time the error code 266 is raised
it still has severity of 16 and not 10.
-----Original Message-----
EXEC sp_configure 'allow updates', '1'
RECONFIGURE WITH OVERRIDE
GO
UPDATE master.dbo.[sysmessages]
SET severity = 16
WHERE error = 266
AND severity = 10
EXEC sp_configure 'allow updates', '0'
RECONFIGURE WITH OVERRIDE
Post by BuddyWork
Hello,
Can someone please give me an example of how I can
change
Post by BuddyWork
the severity of 16 to severity of 10 for Err 266.
Thanks
.
Delbert Glass
2004-02-05 15:47:40 UTC
Permalink
Post by BuddyWork
I've tried this and each time the error code 266 is raised
it still has severity of 16 and not 10.
Something to try:
Try shutting down, then startup.
Perhaps your change will then "get noticed".

But even if you are able to switch it,
doing so is seems to be begging for problems
for this particular error. Think about it, the implementation
was developed under the given that stored procedures
are not allowed to leave the @@TRANSCOUNT level modified.
You are changing the given (well, trying to).

Rather than just making a general wish that severity levels can be changed,
you would want to also make a specific wish for this given to be changed (or
changeable).

Bye,
Delbert Glass
Louis Davidson
2004-02-05 16:04:06 UTC
Permalink
This is a bad bad bad idea. Why do you need to change the Severity? What
is the severity causing you?
--
----------------------------------------------------------------------------
-----------
Louis Davidson (***@hotmail.com)
Compass Technology Management

Pro SQL Server 2000 Database Design
http://www.apress.com/book/bookDisplay.html?bID=266

Note: Please reply to the newsgroups only unless you are
interested in consulting services. All other replies will be ignored :)
Post by Anthony Faull
EXEC sp_configure 'allow updates', '1'
RECONFIGURE WITH OVERRIDE
GO
UPDATE master.dbo.[sysmessages]
SET severity = 16
WHERE error = 266
AND severity = 10
EXEC sp_configure 'allow updates', '0'
RECONFIGURE WITH OVERRIDE
Post by BuddyWork
Hello,
Can someone please give me an example of how I can change
the severity of 16 to severity of 10 for Err 266.
Thanks
BuddyWork
2004-02-06 15:16:26 UTC
Permalink
I'll explain the issue,

We are converting code to C# from a language called AM, AM
uses DB-Library to talk to SQL Server, DB-Library would
ignore severity checking return any results after the
error, ADO.Net throws a SQL Exception when an error of
severity of 11 or above is raise, so for us to get the
code to work we have to change all our RAISERROR's to use
serverity of 10 so ADO.Net does not throw a SQLException.
When it throws the SQLException there is no way to
retrieve the data.
Example,
RAISERROR "No Clients within this branch",16,1
IF @@ERROR>0
BEGIN
SELECT * FROM Employee
END

We basically do not get the results back when a system
generated error is raised with the error code less than
50000.
-----Original Message-----
This is a bad bad bad idea. Why do you need to change
the Severity? What
is the severity causing you?
--
----------------------------------------------------------
------------------
-----------
Compass Technology Management
Pro SQL Server 2000 Database Design
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are
interested in consulting services. All other replies
will be ignored :)
Post by Anthony Faull
EXEC sp_configure 'allow updates', '1'
RECONFIGURE WITH OVERRIDE
GO
UPDATE master.dbo.[sysmessages]
SET severity = 16
WHERE error = 266
AND severity = 10
EXEC sp_configure 'allow updates', '0'
RECONFIGURE WITH OVERRIDE
Post by BuddyWork
Hello,
Can someone please give me an example of how I can
change
Post by Anthony Faull
Post by BuddyWork
the severity of 16 to severity of 10 for Err 266.
Thanks
.
Louis Davidson
2004-02-06 15:45:39 UTC
Permalink
Can't you ignore the error? I am not into the .NET coding thing yet (though
Yukon will get me there soon enough) but I would suppose you would do
something along the lines of ON ERROR RESUME. Check the error, see if it
is one that you don't care about, and then RESUME. I think TRY CATCH can do
this, right?
--
----------------------------------------------------------------------------
-----------
Louis Davidson (***@hotmail.com)
Compass Technology Management

Pro SQL Server 2000 Database Design
http://www.apress.com/book/bookDisplay.html?bID=266

Note: Please reply to the newsgroups only unless you are
interested in consulting services. All other replies will be ignored :)
Post by BuddyWork
I'll explain the issue,
We are converting code to C# from a language called AM, AM
uses DB-Library to talk to SQL Server, DB-Library would
ignore severity checking return any results after the
error, ADO.Net throws a SQL Exception when an error of
severity of 11 or above is raise, so for us to get the
code to work we have to change all our RAISERROR's to use
serverity of 10 so ADO.Net does not throw a SQLException.
When it throws the SQLException there is no way to
retrieve the data.
Example,
RAISERROR "No Clients within this branch",16,1
BEGIN
SELECT * FROM Employee
END
We basically do not get the results back when a system
generated error is raised with the error code less than
50000.
-----Original Message-----
This is a bad bad bad idea. Why do you need to change
the Severity? What
is the severity causing you?
--
----------------------------------------------------------
------------------
-----------
Compass Technology Management
Pro SQL Server 2000 Database Design
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are
interested in consulting services. All other replies
will be ignored :)
Post by Anthony Faull
EXEC sp_configure 'allow updates', '1'
RECONFIGURE WITH OVERRIDE
GO
UPDATE master.dbo.[sysmessages]
SET severity = 16
WHERE error = 266
AND severity = 10
EXEC sp_configure 'allow updates', '0'
RECONFIGURE WITH OVERRIDE
Post by BuddyWork
Hello,
Can someone please give me an example of how I can
change
Post by Anthony Faull
Post by BuddyWork
the severity of 16 to severity of 10 for Err 266.
Thanks
.
BuddyWork
2004-02-06 16:00:31 UTC
Permalink
I wish it was that simple but Microsoft have based ADO.Net
on ADO, and the rules are that if you get a serverity
error of 11 or above the ADO/ADO.Net will throw an SQL
Exception and WILL NOT retrieve the data after the
exception even through it's still in the SQL Server stream.

In DB-Library we where able to ignore this because when
the code was orginially written we where using SQL Server
4.2 and there was no support for severity in the DB-
Library API's so you where able to read the SQL Server
stream and get the data even though there was an error.

Thanks
-----Original Message-----
Can't you ignore the error? I am not into the .NET
coding thing yet (though
Yukon will get me there soon enough) but I would suppose
you would do
something along the lines of ON ERROR RESUME. Check the
error, see if it
is one that you don't care about, and then RESUME. I
think TRY CATCH can do
this, right?
--
----------------------------------------------------------
------------------
-----------
Compass Technology Management
Pro SQL Server 2000 Database Design
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are
interested in consulting services. All other replies
will be ignored :)
Post by BuddyWork
I'll explain the issue,
We are converting code to C# from a language called AM,
AM
Post by BuddyWork
uses DB-Library to talk to SQL Server, DB-Library would
ignore severity checking return any results after the
error, ADO.Net throws a SQL Exception when an error of
severity of 11 or above is raise, so for us to get the
code to work we have to change all our RAISERROR's to
use
Post by BuddyWork
serverity of 10 so ADO.Net does not throw a
SQLException.
Post by BuddyWork
When it throws the SQLException there is no way to
retrieve the data.
Example,
RAISERROR "No Clients within this branch",16,1
BEGIN
SELECT * FROM Employee
END
We basically do not get the results back when a system
generated error is raised with the error code less than
50000.
-----Original Message-----
This is a bad bad bad idea. Why do you need to change
the Severity? What
is the severity causing you?
--
-------------------------------------------------------
---
Post by BuddyWork
------------------
-----------
Compass Technology Management
Pro SQL Server 2000 Database Design
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you
are
Post by BuddyWork
interested in consulting services. All other replies
will be ignored :)
Post by Anthony Faull
EXEC sp_configure 'allow updates', '1'
RECONFIGURE WITH OVERRIDE
GO
UPDATE master.dbo.[sysmessages]
SET severity = 16
WHERE error = 266
AND severity = 10
EXEC sp_configure 'allow updates', '0'
RECONFIGURE WITH OVERRIDE
Post by BuddyWork
Hello,
Can someone please give me an example of how I can
change
Post by Anthony Faull
Post by BuddyWork
the severity of 16 to severity of 10 for Err 266.
Thanks
.
.
Continue reading on narkive:
Loading...