Collections:
Default Schema of Your Login Session in SQL Server
What Is the Default Schema of Your Login Session in SQL Server?
✍: FYIcenter.com
When you login to a SQL Server and select a database to use, SQL Server will assign your login session a default schema. The schema name can be omitted when you refer to objects in the default schema. Here is what you should remember about default schema:
The tutorial exercise below shows you how to verify your default schema:
-- Login with "fyi_login" USE FyiCenterData; GO Changed database context to 'FyiCenterData'. PRINT User_Name(); GO Fyi_User SELECT name, default_schema_name FROM sys.database_principals WHERE type = 'S'; GO name default_schema_name -------------------- -------------------- dbo dbo guest guest INFORMATION_SCHEMA NULL sys NULL Fyi_User dbo
The last query shows that the default schema for "fyi_login" in "FyiCenterData" is "dbo".
⇒ Who Is the Owner of a Schema in SQL Server
⇐ "sys.objects" - Listing All Objects in a Given Schema in SQL Server
2016-10-22, 2985🔥, 0💬
Popular Posts:
Where to find answers to frequently asked questions on PHP Connections and Query Execution for MySQL...
How To Verify a User name with SQLCMD Tool in SQL Server? The quickest way to verify a user name in ...
What Privilege Is Needed for a User to Delete Rows from Tables in Another Schema in Oracle? For a us...
How To Convert a Unicode Strings to Non-Unicode Strings in SQL Server Transact-SQL? Since Unicode ch...
How To Start the Command-Line SQL*Plus in Oracle? If you Oracle server or client installed on your w...