I want to get a list of all the schemas in this Sql Server database. Using the ADO.NET Schema Search API, I get a list of all the collections, but there is no collection for the Schema. I could move the 'Tables' , 'Procedures' collections (and others if necessary) and get a list of unique schema names, but is there a simpler / shorter way to achieve the same result?
Example: for the standard 'AdventureWorks' database, I would also like to get the following list - dbo,HumanResources,Person,Production,Purchasing,Sales (I skipped other standard schema names, for example db_accessadmin , db_datareader , etc.)
Edit: I can get a list of schemas by querying the system view - INFORMATION_SCHEMA.SCHEMATA , but would prefer to use the schema API as a first choice.
alwayslearning Sep 15 '10 at 16:14 2010-09-15 16:14
source share