Sql server Permisson Query

Posted on 2014-08-12
Last Modified: 2014-08-13
I Created 1 Table and and stored procedure.(Sql server 2008)
I need to give access right to users

I created Group called Group1 and i add some users for that.

For example Table1 and Stored Procedure1
I gave this Grant using code below(T-sql)
 GRANT EXECUTE ON Table1 TO [TestServer1\Group1];
 GRANT EXECUTE ON stored procedure1 TO [TestServer1\Group1];

its execute successfully.

My query is I need to write code using following connection String
connetionString= "Data Source=TestServer1;Initial Catalog=MainDB;Integrated Security=SSPI"

Could you any  one show me How to give permission Table1 and Storedprocedure1

Need grant to access Insert,Delete,Execute store procedures1 and Table1

Question by:ukerandi
    LVL 35

    Accepted Solution


    TestServer\Group1 - how did you add users to that?

    What is the relationship between TestServer and the AD Domain?

    LVL 10

    Author Comment

    Create User group in TestServer
    , Then Add users to that Usergroup1

    All users in the group available in the AD directory
    for example 1 user name
    Then AD Directory also User1
    LVL 42

    Assisted Solution

    there is no execute action on table.
    if you plan to read data from table

    USE yourdb
    GRANT SELECT ON Table1 TO [TestServer1\Group1];


    GRANT Object Permissions (Transact-SQL)

    also make sure
    that login that is executing this connection is member of this windows group  [TestServer1\Group1] that must be added to sql logins;
    connetionString= "Data Source=TestServer1;Initial Catalog=MainDB;Integrated Security=SSPI"

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
    Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

    760 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

    7 Experts available now in Live!

    Get 1:1 Help Now