Solved

Permissions on views

Posted on 2002-04-16
7
191 Views
Last Modified: 2012-06-21
I like to give a user permission to crete views but don't want him to change/modify/delete data or table. What is the best way to setup this user?

Thanks.

Jammy
0
Comment
Question by:jlislo
  • 4
  • 3
7 Comments
 
LVL 69

Expert Comment

by:ScottPletcher
Comment Utility
You can issue this command:

GRANT CREATE VIEW TO user_name
0
 

Author Comment

by:jlislo
Comment Utility
It this work for only one view or is a long time grant until I DisGrant (I don't know the command) one month later?

Thanks.
0
 
LVL 69

Expert Comment

by:ScottPletcher
Comment Utility
That command will allow that user to create any number of views.  It does stay in effect until you issue a REVOKE, so it would be in effect one month later, one year later, etc..  
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 69

Expert Comment

by:ScottPletcher
Comment Utility
Also, that user will be able to DROP any view he/she created, but not a view created by another id.
0
 

Author Comment

by:jlislo
Comment Utility
Can I give the use just Public permision or I have to give him something like db_datawriter...etc rights.

I know I ask a lot so I increase points.

Thanks.
0
 
LVL 69

Accepted Solution

by:
ScottPletcher earned 100 total points
Comment Utility
The "GRANT CREATE VIEW TO user_name" just gives that one specific permission.  You can go into Query Analyzer and issue that command, and that user can then create views (and alter/delete any views he/she created, but no other users' views).

Db_datawriter, etc., are roles that essentially grant a lot of permissions.  I don't think that will help you here, because the only role (other than db_owner) that includes CREATE VIEW is db_ddladmin, and that gives a lot of other rights as well (such as ALTER TABLE, CREATE INDEX, CREATE TABLE, etc.).
0
 

Author Comment

by:jlislo
Comment Utility
Thank you very much for the help.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how the fundamental information of how to create a table.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now