'U' value for xtype column which shows the object is a [user table].
USE AclMacGen
GO
IF EXISTS (
SELECT *
FROM sysobjects
WHERE
id = OBJECT_ID('[myDB].[dbo].[myTable]')
AND xtype = 'U'
)
BEGIN
SELECT 'It is EXIST'
END
- The second way is just by checking availability of specific
table as an object in the database.
IF OBJECT_ID('[myDB].[dbo].[myTable]') IS NOT NULL
BEGIN
SELECT 'It is EXIST'
END
No comments:
Post a Comment