ranta
Programmer
- Jun 24, 2003
- 30
From within a stored procedure I am trying to detect whether a table exists, however the table is in a different database to the SP, I have tried using the following code but this only works where the table and the SP are in the same database...
if exists (select * from dbo.sysobjects where id = object_id('NA_052003_BP') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
Any ideas???
Thanks
if exists (select * from dbo.sysobjects where id = object_id('NA_052003_BP') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
Any ideas???
Thanks