Tuesday, June 24, 2014

To get the list of tables in sql server

SELECT * FROM information_schema.tables
OR
SELECT sobjects.name FROM sysobjects sobjects WHERE sobjects.xtype = 'U'

-The list of other object types you can search for

C: Check constraint
D: Default constraint
F: Foreign Key constraint
L: Log
P: Stored procedure
PK: Primary Key constraint
RF: Replication Filter stored procedure
S: System table
TR: Trigger
U: User table
UQ: Unique constraint
V: View
X: Extended stored procedure

No comments:

Post a Comment