Connecting Tech Pros Worldwide Help | Site Map

Application Roles and SQL Server 2005 - DDL?

  #1  
Old September 30th, 2008, 08:55 AM
JimL
Guest
 
Posts: n/a
Hello group,

We have recently come up with a problem where SQLServer 2005 differs
from 2000.

We have an application role, which needs to run DDL to alter tables
etc. The documentation for 2005 states quite clearly that application
roles cannot be made members of built in roles like db_owner or
db_ddladmin - which proves to be the case, but this was possible in
2000.

How are we to give application roles these rights in 2005 (and, for
all I know 2008)?

Thanks,

Jim

  #2  
Old September 30th, 2008, 09:15 AM
Eric Isaacs
Guest
 
Posts: n/a

re: Application Roles and SQL Server 2005 - DDL?


When you create an object such as a stored procedure, try declaring it
WITH EXECUTE AS OWNER. If dbo owns the procedure, it will execute as
dbo. Anyone that has permission to run that sproc has the required
permission. Just make sure any other spocs it calls also have this
permission declared. That should help with most of the permission
issues.

http://www.mssqltips.com/tip.asp?tip=1227

-Eric Isaacs
  #3  
Old September 30th, 2008, 11:05 PM
Erland Sommarskog
Guest
 
Posts: n/a

re: Application Roles and SQL Server 2005 - DDL?


JimL (jmlawton@gmail.com) writes:
Quote:
We have recently come up with a problem where SQLServer 2005 differs
from 2000.
>
We have an application role, which needs to run DDL to alter tables
etc. The documentation for 2005 states quite clearly that application
roles cannot be made members of built in roles like db_owner or
db_ddladmin - which proves to be the case, but this was possible in
2000.
>
How are we to give application roles these rights in 2005 (and, for
all I know 2008)?
Not sure that I understand. This worked fine for me on SQL 2005:

create application role approlle with password = 'rolle'
exec sp_addrolemember db_owner, approlle



--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error "SQL Server does not allow remote connections" Cirene answers 5 June 27th, 2008 09:07 PM
Replacing VS .NET's SQL Server Express Edition Integration Scott M. answers 10 December 4th, 2007 02:25 PM
ASPNETDB.MDF when no SQLExpress, only SQL Server 2005? nick answers 8 June 20th, 2006 12:45 AM
SQL Server Application Roles Jonathan Allen answers 5 November 23rd, 2005 05:07 AM
SQL Server Application Roles Jonathan Allen answers 5 November 21st, 2005 02:35 PM