Re: cross chema calls fail: schema owner doesn't have execute priv
- From: Omid Golban <OmidGolban@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 11 Apr 2009 21:08:01 -0700
1. Doesn't changing the owner to dbo defeat the purpose of having the schema?
2. The brass wants explicit separation of these procedures - a logical
grouping where all procedures for an external entity will be together inside
their own schema.
3. What about CREATE PROCEDURE WITH EXECUTE AS OWNER? Is that totally wrong?
Thank you,
Omid
"Jeffrey Williams" wrote:
Try changing the ownership on the schema to dbo..
While you are at it, if your procedures are nothing more than a shell to
call a procedure in the 'dbo' schema then I would consider using synonyms
instead. For example:
CREATE SYNONYM crm.MyProcedure FOR dbo.MyProcedure;
GO
EXECUTE crm.MyProcedure @param1, @param2, ...;
Jeff
"Omid Golban" <OmidGolban@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:39ACE9A1-DA87-42D4-9899-F05473ED692C@xxxxxxxxxxxxxxxx
Hi folks,
I am using SQL 2005 and have created a schema:
CREATE SCHEMA [CRM];
Then I created a bunch of stored procs under this schema. These CRM procs
call other [dbo] procs:
CREATE PROCEDURE CRM.Contact_Update
AS
... EXEC dbo.SomeProcedure ...
END
We are logically grouping all CRM procs under this schema. I don't know
the
commands used, but DBA Created:
1. Role ScribeAccess
owner: dbo
owned schemas: CRM
role members: scribe
2. user scribe
default schema: CRM
role members: db_owner, ScribeAccess
DBA had to grant db_owner access to the DatabaseRole "ScribeAccess"
because
CRM user was getting following error when calling a dbo procedure:
[42000] SQL call failed. Uncommittable transaction is detected at the
end
of the batch. The transaction is rolled back.
42000 may be the error that SCRIBE throws, but they have verified problem
was that user CRM does not have permission to execute dbo procs.
Currently I have PROCs under this schema. I don't plan on having anything
else.
how do I provide for cross schema calls?
I am currently changing the procs to "EXECUTE AS OWNER" but I am probably
breaking security rules.
I also do not want to go through each procedure and explicitly grant
execute
access to each schema because in next phase of the project we're going to
have 15 such schemas.
Thank you,
Omid
- Follow-Ups:
- Re: cross chema calls fail: schema owner doesn't have execute priv
- From: Jeffrey Williams
- Re: cross chema calls fail: schema owner doesn't have execute priv
- From: Dan Guzman
- Re: cross chema calls fail: schema owner doesn't have execute priv
- From: Uri Dimant
- Re: cross chema calls fail: schema owner doesn't have execute priv
- References:
- cross chema calls fail: schema owner doesn't have execute privileg
- From: Omid Golban
- Re: cross chema calls fail: schema owner doesn't have execute privileg
- From: Jeffrey Williams
- cross chema calls fail: schema owner doesn't have execute privileg
- Prev by Date: Re: cross chema calls fail: schema owner doesn't have execute privileg
- Next by Date: Re: cross chema calls fail: schema owner doesn't have execute priv
- Previous by thread: Re: cross chema calls fail: schema owner doesn't have execute privileg
- Next by thread: Re: cross chema calls fail: schema owner doesn't have execute priv
- Index(es):
Relevant Pages
|