How do I obtain a list of all schemas in a Sql Server database

前端 未结 6 1248
温柔的废话
温柔的废话 2020-12-13 11:54

I want to retrieve a list of all schemas in a given Sql Server database. Using the ADO.NET schema retrieval API I get a list of all collections but there is no

6条回答
  •  天命终不由人
    2020-12-13 12:30

    Try this query here:

    SELECT * FROM sys.schemas
    

    This will give you the name and schema_id for all defines schemas in the database you execute this in.

    I don't really know what you mean by querying the "schema API" - these sys. catalog views (in the sys schema) are your best bet for any system information about databases and objects in those databases.

提交回复
热议问题