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.
| Author |
Topic |
|
danielbarea
Starting Member
3 Posts |
Posted - 2005-04-20 : 09:39:59
|
| Hi, anyboby knows how to hide or clear warnings shown by SQL Server.I need to clear or to avoid this message "Advertencia: al cambiar cualquier parte del nombre de un objeto pueden dejar de ser válidas secuencias de comandos y procedimientos almacenados.El object ha cambiado su nombre por 'SENTENCIAS_SQL'." I've a SP with a sp_rename first and and an insert sentence in a second place. I' m using ADO to call the SP.if an error ocurrs in the insert sentence I get in aDo errors the complete sql message which starts with "Advertencia: al cambiar cualquier ..." and i want to get only the error.thanks in advance!Daniel |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-04-20 : 10:03:05
|
| I assume the first message is the warning about changing an object name. And if an error occurs on the insert it's because a table constraint is being violated. If this is true, why don't you test for the error condition before you attempt the insert. If you see that the error will occur, don't attempt it, just use raiserror to raise whatever error you want. Since your custom error's severity level will be lower than the fatal error raised by the constraint violation, only your custom message will be returned with the error.It is not a good idea to be renaming db objects from asp code. If you want to explain your objectives we might be able to suggest a different approach.Be One with the OptimizerTG |
 |
|
|
danielbarea
Starting Member
3 Posts |
Posted - 2005-04-20 : 10:41:39
|
| yes, the first warning is about changing an object name. About the error, the insert sentence was only an example to simplify. The second sentence is more complex and the error is a deadlock: "[Microsoft][ODBC SQL Server Driver][SQL Server]La transacción (Id. de proceso 55) quedó en interbloqueo en lock recursos con otro proceso y fue elegida como sujeto del interbloqueo. Ejecute de nuevo la transacción.({-2147467259} Microsoft OLE DB Provider f" so, i can't prevent this before the rename. there are several process running. I want to prevent the deadlocks but I first want to capture the right error message.Thanks |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-04-20 : 11:45:02
|
| In regards to capturing the correct message, are you concerned about what text you presentthe users? If so, could you just check the error number? If it's a deadlock error (1205, 1211),then replace the actual error text with a custom message. If it's not being presented to the user then what is the big deal of also including the rename warning?In regards to the deadlock, how prevelant is this problem? Do you know what is causing them yet?If you want assistance with that, post what you know so far...Be One with the OptimizerTG |
 |
|
|
|
|
|
|
|