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.
| Author |
Topic |
|
raysefo
Constraint Violating Yak Guru
260 Posts |
Posted - 2006-05-13 : 09:24:43
|
| Hi,i wanna know if a specific table is already in a db. How can i do it?thanks |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-05-13 : 09:32:26
|
You can use INFORMATION_SCHEMA or sysobjectsselect * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'MyTable' select * from sysobjects where xtype = 'U' and name = 'MyTabble' KH |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-05-14 : 03:21:33
|
Another wayif objectproperty(object_id('dbo.authors'),'IsUserTable') = 1 print 'table exists'else print 'table does not exist'CODO ERGO SUM |
 |
|
|
|
|
|