﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / SQL Server 2005 Security  / SQL Server 2005 Stored Procedure Permissions / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 14:38:07 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: SQL Server 2005 Stored Procedure Permissions</title><link>http://www.sqlservercentral.com/Forums/Topic640254-359-1.aspx</link><description>-- Create a new role CREATE ROLE SP_Fn_executor-- Grant execute to the created roleGRANT EXECUTE TO SP_Fn_executor The above statement would create a role and grant execute permission on all existing stored procedures and scalar functions.And as when we create new ones the permission would automatically be given to the Role.</description><pubDate>Tue, 19 Oct 2010 23:25:17 GMT</pubDate><dc:creator>santosh_mahajan</dc:creator></item><item><title>RE: SQL Server 2005 Stored Procedure Permissions</title><link>http://www.sqlservercentral.com/Forums/Topic640254-359-1.aspx</link><description>In SQL Server 2005 you can define the execution context of the following user-defined modules: functions (except inline table-valued functions), procedures, queues_________________[url=http://www.microsoftoffice-2010.com/] Download Microsoft 2010 [/url] </description><pubDate>Sat, 23 Jan 2010 09:08:50 GMT</pubDate><dc:creator>rojen83</dc:creator></item><item><title>RE: SQL Server 2005 Stored Procedure Permissions</title><link>http://www.sqlservercentral.com/Forums/Topic640254-359-1.aspx</link><description>Easy way to give users/developers view permission to Stored Procedures in SQL 2005:USE AdventureWorksGO  CREATE PROCEDURE usp_ExecGrantViewDefinition  (@login VARCHAR(30))  AS  /* Included Object Types are:  P - Stored Procedure  V - View  FN - SQL scalar-function TR - Trigger  IF - SQL inlined table-valued function TF - SQL table-valued function U - Table (user-defined) */  SET NOCOUNT ON  CREATE TABLE #runSQL (runSQL VARCHAR(2000) NOT NULL)  --Declare @execSQL varchar(2000), @login varchar(30), @space char (1), @TO char (2)  DECLARE @execSQL VARCHAR(2000), @space CHAR (1), @TO CHAR (2)  SET @to = 'TO' SET @execSQL = 'Grant View Definition ON '  SET @login = REPLACE(REPLACE (@login, '[', ''), ']', '') SET @login = '[' + @login + ']' SET @space = ' ' INSERT INTO #runSQL  SELECT @execSQL + schema_name(schema_id) + '.' + [name] + @space + @TO + @space + @login  FROM sys.all_objects s  WHERE type IN ('P', 'V', 'FN', 'TR', 'IF', 'TF', 'U')  AND is_ms_shipped = 0  ORDER BY s.type, s.name  SET @execSQL = ''  Execute_SQL:  SET ROWCOUNT 1  SELECT @execSQL = runSQL FROM #runSQL PRINT @execSQL --Comment out if you don't want to see the output EXEC (@execSQL) DELETE FROM #runSQL WHERE runSQL = @execSQL IF EXISTS (SELECT * FROM #runSQL)     GOTO Execute_SQL  SET ROWCOUNT 0 DROP TABLE #runSQL  GO   Once this procedure has been created you can grant the permissions as follows. This example grants view definition to a user "XYZ" in "Adventureworks" Database for all object types that were selected.USE AdventureworksGO EXEC usp_ExecGrantViewDefinition 'XYZ' GO   </description><pubDate>Thu, 21 Jan 2010 10:04:31 GMT</pubDate><dc:creator>Prakash.Bhojegowda</dc:creator></item><item><title>RE: SQL Server 2005 Stored Procedure Permissions</title><link>http://www.sqlservercentral.com/Forums/Topic640254-359-1.aspx</link><description>Brian, I like this way better than my idea..:-)</description><pubDate>Wed, 21 Jan 2009 08:33:58 GMT</pubDate><dc:creator>Roy Ernest</dc:creator></item><item><title>RE: SQL Server 2005 Stored Procedure Permissions</title><link>http://www.sqlservercentral.com/Forums/Topic640254-359-1.aspx</link><description>Even db_ddladmin is overkill.Grant CREATE PROC to a role. Put developers in that role.Grant ALTER SCHEMA on the schema(s) that the developers need to modify stored procedures in to the role.Grant VIEW DEFINITION on the schema(s) that the developers need to modify stored procedures in to the role.See if that does the job.</description><pubDate>Wed, 21 Jan 2009 08:28:23 GMT</pubDate><dc:creator>K. Brian Kelley</dc:creator></item><item><title>RE: SQL Server 2005 Stored Procedure Permissions</title><link>http://www.sqlservercentral.com/Forums/Topic640254-359-1.aspx</link><description>I agree, they will have view only access to any production objects.  It has been difficult finding the right balance to allow development and debugging without giving too much permission.  Thank you for responding!kay</description><pubDate>Wed, 21 Jan 2009 07:03:00 GMT</pubDate><dc:creator>kwilt</dc:creator></item><item><title>RE: SQL Server 2005 Stored Procedure Permissions</title><link>http://www.sqlservercentral.com/Forums/Topic640254-359-1.aspx</link><description>I think even a db_owner is an overkill. What I would suggest is to create a Role with the ddl_Admin as the rights to that particular DB and add the developers who need access to compile Stored procs to that role.If I was in your shoes, I would never give a Developer access to even read data (forget compiling Stored proc :exclamationmark: ) to a developer in the production Environment.</description><pubDate>Wed, 21 Jan 2009 06:59:13 GMT</pubDate><dc:creator>Roy Ernest</dc:creator></item><item><title>RE: SQL Server 2005 Stored Procedure Permissions</title><link>http://www.sqlservercentral.com/Forums/Topic640254-359-1.aspx</link><description>Moved to SS2005 forumI tend to agree with Markus' advice.Don't grant this advice to public, however, create your own role.</description><pubDate>Wed, 21 Jan 2009 03:54:08 GMT</pubDate><dc:creator>Steve Jones - SSC Editor</dc:creator></item><item><title>RE: SQL Server 2005 Stored Procedure Permissions</title><link>http://www.sqlservercentral.com/Forums/Topic640254-359-1.aspx</link><description>First of all I think you will get better response if you post a 2005 question in the appropriate forum.Now to your question. There are a couple od roles which by default can view properties of a stored procedure. Sysadmin will work, but is total overkill. db_owner or ddl_admin would be a much better choice. GRANT VIEW DEFINITION will also work.But keep in mind that it's not possible to grant any this permission on one specific procedure. The grantee will be able to see definition and properties of all database objects. </description><pubDate>Wed, 21 Jan 2009 03:32:52 GMT</pubDate><dc:creator>MarkusB</dc:creator></item><item><title>RE: SQL Server 2005 Stored Procedure Permissions</title><link>http://www.sqlservercentral.com/Forums/Topic640254-359-1.aspx</link><description>Generally, SPs need to be given EXEC permission for those who need to run the SPs.For this, permission will be provided after creating / altering the SPs likeGRANT EXEC on    - Here PUBLIC can be used to provide EXEC permission to ALL who have access permission to the DB / Server.You can give the specific permission for the User using:GRANT  </description><pubDate>Wed, 21 Jan 2009 02:29:40 GMT</pubDate><dc:creator>Suresh.Utham</dc:creator></item><item><title>SQL Server 2005 Stored Procedure Permissions</title><link>http://www.sqlservercentral.com/Forums/Topic640254-359-1.aspx</link><description>On a development server, we have users who need to be able to modify, execute and view properties of stored procedures.  I have tried combinations of permissions such as Alter, Control and View but when they try to view the properties, they receive the following error message:Property Default Schema is not available for Database "[database_name]".  This property may not exist for the object, or may not be retrievable due to insufficient access rights.Is there some combination aside from sysadmin that allows viewing stored procedure properties?</description><pubDate>Tue, 20 Jan 2009 14:32:21 GMT</pubDate><dc:creator>kwilt</dc:creator></item></channel></rss>