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 |
|
sanctos
Starting Member
19 Posts |
Posted - 2007-02-09 : 16:51:31
|
| Hi everyone,I am having trouble being able to handle an error that calls an non-existing table name. I am just doing this for testing purposes. Any ideas? |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-02-09 : 17:51:52
|
Instead of trapping an error, why don't you just check to make sure the table exists before trying to access it?This code shows one way to check if a table exists.if objectproperty(object_id('dbo.MyTable'),'IsUserTable') = 1 begin select * from dbo.MyTable endCODO ERGO SUM |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|