In my last post I show You how create login in server, in this I present how do it througth T-SQL query.
First go to
Security->Logins node and expands it.
You see defaut
sa login and login creating in last post throught
SQL Server Management Studio. Go to the query editor and copy this code:
CREATE LOGIN dorota
WITH PASSWORD = 'DoRoTa2211';
This sql query create login
WITH PASSWORD = You must write as text password for this login. My password is
DoRoTa2211 . If You execute this query, show
Logins node in
Object Explorer window. If new login is not visible, refresh this node.
After refresh You see your new login:
As You may see the databases(except system databases as master, tempdb, … ) will not be accessible for this login and user. Why? Because this creating user is not admin.
You may execute procedure adding
sysadmin role for server:
exec sp_addsrvrolemember 'dorota', 'sysadmin' ;
Login Properties window You see new role: