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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 table exist check

Author  Topic 

desikankannan
Posting Yak Master

152 Posts

Posted - 2013-11-12 : 04:33:03
Hi,

i want to check the if table exist in the database , i want to drop the table and again create the table, i want to the sample script for that


Desikankannan

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2013-11-12 : 04:47:14
[code]if object_id('dbo.yourtable') is not null
begin
drop table dbo.yourtable
end
create table yourtable (id int)
[/code]


Too old to Rock'n'Roll too young to die.
Go to Top of Page
   

- Advertisement -