Collections:
sys.schemas - Listing All Schemas in a Database in SQL Server
How To List All Schemas in a Database in SQL Server?
✍: FYIcenter.com
If you want see all existing schemas in the current database, you can use view sys.schemas as shown in the example below:
USE FyiCenterData; GO SELECT * FROM sys.schemas; GO name schema_id principal_id -------------------- ----------- ------------ dbo 1 1 guest 2 2 INFORMATION_SCHEMA 3 3 sys 4 4 fyi 5 1 db_owner 16384 16384 db_accessadmin 16385 16385 db_securityadmin 16386 16386 db_ddladmin 16387 16387 db_backupoperator 16389 16389 db_datareader 16390 16390 db_datawriter 16391 16391 db_denydatareader 16392 16392 db_denydatawriter 16393 16393 (14 row(s) affected)
All schemas, except "fyi", in the list were created by SQL Server.
⇒ Creating a New Table in a Given Schema in SQL Server
⇐ "CREATE SCHEMA" - Creating a New Schema in a Database in SQL Server
2016-10-22, 3783🔥, 0💬
Popular Posts:
How To Generate Random Numbers with the RAND() Function in SQL Server Transact-SQL? Random numbers a...
What Are Out-of-Range Errors with DATETIME values in SQL Server Transact-SQL? When you enter DATETIM...
How To Download Oracle Database 10g XE in Oracle? If you want to download a copy of Oracle Database ...
How to set the current database in SQL Server? Once you are connected to the SQL Server, you should ...
How To Locate and Take Substrings with CHARINDEX() and SUBSTRING() Functions in SQL Server Transact-...