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)
 Trapping Errors

Author  Topic 

pattikay
Starting Member

36 Posts

Posted - 2001-07-24 : 06:56:32
I read an article in the FAQ on this topic but i am still unable to do
the following:
Is it possible to trap an error that occurs when a statement is executed dynamically i.e

set @dbexists = 'select dbid from '+@servername+'.master.dbo.sysdatabases where name = "'+@dbname+'"'

if for one reason or the other an error occurs ,maybe because the server is not available or for any other reason during the statements execution , how do i trap the error and move to the next statement in the stored procedure?

Thanks in advance.





Edited by - pattikay on 07/24/2001 07:12:20
   

- Advertisement -