Avatar of r_pat72
r_pat72
 asked on

SQL SERVER - Help with Read only Permission script on a SQL View

Hello,


I have a SQL Server Database on Azure. I have created a view from a table wants to give read only access to that view only to a new login/user. I need some help on this.

1) Creating a new login/user 

2) Granting read only permission to that view


Can someone help with this script?


DatabasesMicrosoft SQL Server

Avatar of undefined
Last Comment
ste5an

8/22/2022 - Mon
r_pat72

ASKER
I came up with this following script. Is this looks good?

CREATE LOGIN User1 WITH PASSWORD = '<enterStrongPasswordHere>'    
GO

GRANT SELECT ON OBJECT::[dbo].[myview] TO User1
ASKER CERTIFIED SOLUTION
ste5an

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck