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
  • 66,275
  • 5
  • 31
  • 57
sai Kumar
  • 43
  • 3
  • 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
  • 38,909
  • 3
  • 38
  • 62
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
  • 12,566
  • 16
  • 32
  • 51