Kobe Francisco
BT-506
ADVANCED DATABASE
1. Open/launchtheMicrosoftSQLServer2017fromyourWindowscomputerandusethedefaultlogin
using Windows Authentication
2. Next,right-clicktheserverinstancenameandselectPropertiesto opentheProperty window.
3. From the property window, select the Security taband enable the SQL Userlogin to SQL
Server by
selectingtheSQLServerandWindowsAuthenticationmodeandclickOK.SQLServerisconfiguredfo
r
mixed-modelogin.
4. TocreateSQLLogin,right-clicktheSecuritytabagainandselectNew,thenLogin.TheLogindialogbox
shall appear.
11.Tocheckthenewlycreatedlogin,expandtheSecurityfolder,andexpandtheLoginfolder.
13.WecannowusethenewlycreatedLogin.Todothis,right-clicktheserverinstancenameandselect
Connect
Try to open/access the “demo” database inUser1 loginby expandingthe Databases folder and
expand the “demo”. You will get an error like this. (See the image below)
Inordertoaccessit,youneedtocreateauserforthatdatabase.Tocreateauser,undertheWindows
defaultlogin,expandtheDatabases,thenexpanddemo.ExpandtheSecurity folderandright-clickthe
Users folder, then click New User
PutUser1asusername,andlocatetheUser1inLoginname.
Togivepermission,undertheWindowsdefaultlogin,expandtheDatabases, thenexpanddemo.Expand
the Security folder, right-click the Roles folder, then select New Database Role.
UndertheGeneraltab,createauser-definedrolenameddb_demo_access.ThenundertheSecurables
tab, click Search.
ClickAllobjectsbelongingtotheschema:thenclickdboorthenameofthedatabase.Then,clickOK.
Wewantto give the user-defined Role permission where he canonly readandupdate the data from
the demo database. To do this, check the grant corresponding to SELECT and UPDATE. Then
click OK