May 13, 2008 at 2:02 am
Hi,
how to check specified table exists in the database or not,
means
Database name is master
table name is table1
how to check if table1 exists or not in the master(database)
plz help in this regard.....
May 13, 2008 at 2:16 am
IF EXISTS (SELECT 1 from master.dbo.sysobjects where name = 'Table1' and xtype = 'U')
BEGIN
-- do something here.
END
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 13, 2008 at 2:56 am
Concur...
if you don't want to do something ,then simply
select name from master.dbo.sysobjects where name ='Table1' and xtype ='U'
karthik
May 15, 2008 at 2:00 am
GilaMonster (5/13/2008)
IF EXISTS (SELECT 1 from master.dbo.sysobjects where name = 'Table1' and xtype = 'U')BEGIN
-- do something here.
END
Hi Gila,
I don't understand, Are you spend all of your day in sql servercentral?, why i am asking this question is before i answer the post always i am finding your post prior
tell me any special techniq ..........
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply