Re: Question about View permissions



B. Chernick (BChernick@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
(I'm a little rusty on SQL admin and security. Please refresh my memory.)

I'm writing an ASP.Net 2.0 demo using a SQL Server 2000 database,
nothing too fancy. For the purpose of this demo I have created a SQL
authentication login and granted it ownership of this one database.

A little while later, I had a need to create a view to populate one of
the Object Data Sources on a web page. This worked fine while I was in
my own development environment but when published the site to the server
using that SQL login, the page with the o.d.s. started crashing. After
a little bit of trial and error, I found that this would not work unless
I went into the database and explcitly granted the view Select
permission on both the demo's SQL authentication login and 'guest'.
(The view's permissions were originally completely blank.)

Is this normal operating procedure for setting up Views or could I be
forgetting something at a higher level?

In SQL Server a view is not something you grant permission to access
something. You grant principals access to the view. But maybe when you talk
about a "view" you mean a web page or something else?

But in case, this is a view in SQL, yes, you have to grant the SQL
login with which you access the database SELECT permission on the
view one way or another.


--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: MS Access DAO -> ADO.NET Migration
    ... William Vaughn ... Microsoft MVP ... Hitchhiker's Guide to Visual Studio and SQL Server ... My migration app works building a SSCE database file with imported data ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Complete Neophyte Question(s)
    ... I have a user named james on a database. ... WITH GRANT is one of the more esotheric features in SQL Server in my ... Or does that depend on the permission? ... CREATE USER erik ...
    (microsoft.public.sqlserver.security)
  • Re: Cluster will not fail over.
    ... > As far as the TCP/IP issue goes, you had to rebuild the cluster and were ... > able to restore the master database. ... > a cluster installation you'll have to revisit. ... >> This worked bringing up the sql server in minimal mode. ...
    (microsoft.public.sqlserver.clustering)
  • Re: Word 2003/Access2000/SQLSVR
    ... SQL server being where the data is held and this is accessed through a MS ... entire database and that may be say a record for Berkshire. ... "Peter Jamieson" wrote: ... replaced with the first record on the table in use. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: MS Access DAO -> ADO.NET Migration
    ... full SQL Server and I see the logic you explained in a multi user ... allow two users to access the same database file Read/Write at any given ... The book was a pleasure to read after the gibberish that Microsoft 'puts ... Hitchhiker's Guide to Visual Studio and SQL Server ...
    (microsoft.public.dotnet.framework.adonet)