Collections:
"CREATE USER" - Creating a User Name in a Database in SQL Server
How To Create a User Name in a Database in SQL Server?
✍: FYIcenter.com
User names are security principals at the database level. If you want to allow a login name to access a specific database, you need to create a user name in that database and link it to the login name.
Creating a user name can be done by using the "CREATE USER" statement as shown in this tutorial exercise:
-- Login with "sa" -- Create a login CREATE LOGIN Fyi_Login WITH PASSWORD = 'IYF' GO -- Select a database USE FyiCenterData; GO -- Create a user and link it to a login CREATE USER Fyi_User FOR LOGIN Fyi_Login; GO
Login name "Fyi_Login" should be able to access database "FyiCenterData" through user name "Fyi_User".
Â
2016-10-19, 1017👍, 0💬
Popular Posts:
How to set database to be READ_ONLY in SQL Server? Databases in SQL Server have two update options: ...
Why I Can Not Enter 0.001 Second in DATETIME values in SQL Server Transact-SQL? If you enter millise...
What Happens If the Imported Table Already Exists in Oracle? If the import process tries to import a...
How To Query Tables and Loop through the Returning Rows in MySQL? The best way to query tables and l...
How To Break Query Output into Pages in MySQL? If you have a query that returns hundreds of rows, an...