[dba-SQLServer] If Exists puzzle

Arthur Fuller fuller.artful at gmail.com
Mon Jul 16 08:23:37 CDT 2012


Thanks. David McAfee's suggestion works perfectly.
Arthur

On Mon, Jul 16, 2012 at 9:19 AM, Robert Stewart <rls at webedb.com> wrote:

> Arthur,
>
> Is this a temp table?
>
> If so, it is not in your database, it is in the tempdb.
>
> Another suggestion is to take of the 1 in SELECT 1.
> A second one is to use sys.All_Objects and filter for the table objects
> and the table name.
> See below:
>
> SELECT     name, type, type_desc
> FROM         sys.all_objects
> WHERE     (type_desc = N'USER_TABLE') AND (name = N'AssetUser')
>
>
>


More information about the dba-SQLServer mailing list