?
Solved

View Permissions

Posted on 2011-10-27
2
Medium Priority
?
306 Views
Last Modified: 2012-05-12
Have a database DB1 owned by say 'User1', and another database DB2 owned by say 'User2'.

The DB1 database has various views defined and currently only User1 needs to use these views. In the future, we need to allow User2 to be able run these DB1 database views as well.

What is the best way to implement this, please ?
0
Comment
Question by:raymurphy
2 Comments
 
LVL 21

Accepted Solution

by:
JestersGrind earned 2000 total points
ID: 37038562
Assuming both databases are on the same server.

USE DB1
GO

CREATE USER User2 FOR LOGIN User2
GO

GRANT SELECT ON OBJECT:: View1 TO User2;
GRANT SELECT ON OBJECT:: View2 TO User2;
...

Greg

0
 

Author Closing Comment

by:raymurphy
ID: 37043736
Hadn't realised it woudl be as straightforward as that - thanks a lot for this, much appreciated.
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question