Select name from sysobjects where type = 'U'
Select count (*) from sysobjects where id = object_id ('database name. Owner. Table name ')
Object_id
Returns the ID of the database object.
Syntax
Object_id ('object ')
Parameters
'Object'
The object to use. The object data type is Char or nchar. If the object data type is Char, It is implicitly converted to nchar.
Return type
Int
Note
When this parameter is optional for system functions, the system uses the current database, host, server user, or database user. The built-in function must be followed by parentheses.
If you specify a temporary table name, you must add a database name before the temporary table name. For example:
Select object_id ('tempdb .. # mytemptable ')
System functions can be used in the selection list, where clause, and any place where expressions are allowed. For more information, see expressions and where.
Example
The following example shows the ID of the object returned from the authors table in the pubs database.
Use master
Select object_id ('pubs .. Authors ')
The following is the result set:
-----------
1977058079
(1 row (s) affected)