CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    1,901

    [RESOLVED] Restricting Access to Tables - SQL Server

    I have a SQL Server Database 2005

    I would like to be able to "lock out" some tables so that a programmer connecting to the database cannot access certain tables

    Is this possible ?

    Alternatively, I guess we could create anoth database which is a copy of the main database EXCLUDING the tables I want secured, and allow the programmer to access the new database for reporting, etc

    What is the normal way to deal with this requirement ?

    Thanks

  2. #2
    Join Date
    Apr 2005
    Posts
    107

    Re: Restricting Access to Tables - SQL Server

    That is exactly what security in SQL Server is all about.

    You can restrict (or grant) access to anything, nothing, or anything in between. Either manually clamp down on access for that single login, or create a 'Programmer' schema, and apply it to the login.

    You can even restrict access based on columns if you care to go that bad.

  3. #3
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Restricting Access to Tables - SQL Server

    Some links that would help:
    Create a user: http://msdn.microsoft.com/en-us/library/ms173463.aspx
    Assign a specific role to the user: http://msdn.microsoft.com/en-us/library/ms187750.aspx
    Grant permissions on SQL Objects: http://msdn.microsoft.com/en-us/library/ms188371.aspx

  4. #4
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: Restricting Access to Tables - SQL Server

    Read the links provided above:

    Basically - you create different users. Assign those users with the proper rights, to the proper tables and presto - access is restricted

  5. #5
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    1,901

    Re: Restricting Access to Tables - SQL Server

    What more could I ask for ?

    Thanks Guys - terriffic !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured