0

I need to get the schemas list in specific database in MS SQL server, not all schemas list in entire MS SQL server EX: i will get list of Db's like A,B,C from ms sql server.Now i need to fetch all schema list from A

I need a query for that can i get some help here

David Browne - Microsoft
  • 80,331
  • 6
  • 39
  • 67
sai Kumar
  • 43
  • 4
  • Does this answer your question? [How do I obtain a list of all schemas in a Sql Server database](https://stackoverflow.com/questions/3719623/how-do-i-obtain-a-list-of-all-schemas-in-a-sql-server-database) – Nguyễn Văn Phong Jan 18 '20 at 14:46

2 Answers2

2

This can be accomplished using the sys.schemas catalog view:

USE A;
SELECT name 
FROM sys.schemas;

3-part name example:

SELECT name 
FROM A.sys.schemas;
Dan Guzman
  • 43,250
  • 3
  • 46
  • 71
0

You can obtain all schemas from specific database like this

USE Database_Name
SELECT * FROM sys.schemas

Read link below to have a better understanding

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

Nguyễn Văn Phong
  • 13,506
  • 17
  • 39
  • 56