Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE USER testusername WITHOUT LOGIN
- CREATE LOGIN testl
- WITH PASSWORD = 'test'
- CREATE USER test
- FOR LOGIN testl
- GRANT SELECT, INSERT, UPDATE ON Doctor TO test
- SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
- BEGIN TRANSACTION
- EXECUTE AS USER = 'test'
- SELECT *
- FROM Doctor
- INSERT INTO Doctor VALUES ('Johnson', 'Jack',2)
- UPDATE Doctor SET Dep_ID=2 WHERE Doc_ID=71
- SELECT *
- FROM Doctor
- Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.
- Msg 15151, Level 16, State 1, Line 2
- Cannot drop the user 'test', because it does not exist or you do not have permission.
- Msg 15151, Level 16, State 1, Line 3
- Cannot drop the login 'testl', because it does not exist or you do not have permission.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement