Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
a writes "hii wanted to create one table through one procedure.but if that table is already present in the database then first i want to drop it and then to create it.My question ishow do i check whether the particular table already present or not?"
dsdeming
479 Posts
Posted - 2004-12-02 : 08:30:00
IF OBJECT_ID( 'mytable' ) IS NOT NULL drop table mytableDennis
Amethystium
Aged Yak Warrior
701 Posts
Posted - 2004-12-02 : 10:39:57
I think you're better off using the information_schema view already provided. I only use the object_id function if I want to check for the existence of a temp table.------------->>> BREAKING NEWS!!! <<<------------- Saddam Hussien has weapons of mass destrcution
spirit1
Cybernetic Yak Master
11752 Posts
Posted - 2004-12-02 : 12:30:00
why?Go with the flow & have fun! Else fight the flow
Amethystium
Aged Yak Warrior
701 Posts
Posted - 2004-12-02 : 17:59:53
Safer apparently... don't ask me awkward questions please ------------->>> BREAKING NEWS!!! <<<------------- Saddam Hussien has weapons of mass destrcution