Tuesday, March 20, 2012

Query to retreive user tables in sql db

Is there a way to create a query that will return all user tables inside a sql db

ThanxYou can SELECT * FROM a sysobjects table, where
you can filter the records by a 'U'ser type.

Regards,|||Microsoft always advises against querying the system tables directly. You could use the INFORMATION_SCHEMA.Tables view instead.


SELECT * FROM INFORMATION_SCHEMA.Tables WHERE Table_Catalog = 'myDatabase'

Terri|||what about a list of stored procedures using INFORMATION_SCHEMA?|||I am pretty sure you can get those out of INFORMATION_SCHEMA.ROUTINES. Check out the Index of Books Online.

Terri

No comments:

Post a Comment