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

前端 未结 6 1247
温柔的废话
温柔的废话 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条回答
  •  Happy的楠姐
    2020-12-13 12:47

    You can also use the following query to get Schemas for a specific Database user:

    select s.schema_id, s.name as schema_name
    from sys.schemas s
    inner join sys.sysusers u on u.uid = s.principal_id
    where u.name='DataBaseUserUserName'
    order by s.name
    

提交回复
热议问题