Friday, March 30, 2012

Newbie question on dbo permission

Hi all,
I have a sql account in a shared hosting server and my account is able
to execute scripts to create [dbo].* tables and [dbo].* store
procedures.
however, after they are created, if I tried to execute them, I get for
example,
permission denied on object 'GetUserDataByEmail', database 'mypm',
owner 'dbo'.
so after googling around, I found out I had to do
GRANT EXECUTE ON [dbo].[GetUserDataByEmail] TO 'myuser'
then i could execute it.
so i have these questions
1. I always thought in order to be able to create [dbo].* tables, you
need to a dbo?
2. If I'm right with #1, then how come my user can't excute
[dbo].[GetUserDataByEmail], instead I had to explicilty grant execute
access to it?
3. I see in another person's code, it had "GRANT EXECUTE on
dbo.GetUserDataByEmail to public, what does public mean? anybody can
execute it? if so, then what's the point of setting [dbo] to it?
Really appreicate your 2 cents on this. Thanks"Liming" <lmxudotnet@.gmail.com> wrote in message
news:1168466707.519839.206840@.77g2000hsv.googlegroups.com...
> Hi all,
> I have a sql account in a shared hosting server and my account is able
> to execute scripts to create [dbo].* tables and [dbo].* store
> procedures.
> however, after they are created, if I tried to execute them, I get for
> example,
> permission denied on object 'GetUserDataByEmail', database 'mypm',
> owner 'dbo'.
> so after googling around, I found out I had to do
> GRANT EXECUTE ON [dbo].[GetUserDataByEmail] TO 'myuser'
> then i could execute it.
> so i have these questions
> 1. I always thought in order to be able to create [dbo].* tables, you
> need to a dbo?
> 2. If I'm right with #1, then how come my user can't excute
> [dbo].[GetUserDataByEmail], instead I had to explicilty grant execute
> access to it?
> 3. I see in another person's code, it had "GRANT EXECUTE on
> dbo.GetUserDataByEmail to public, what does public mean? anybody can
> execute it? if so, then what's the point of setting [dbo] to it?
> Really appreicate your 2 cents on this. Thanks
>
Is this SQL 2000 or 2005?
David|||Hi
> 1. I always thought in order to be able to create [dbo].* tables, you
> need to a dbo?
You will have to be a member of sysadmin server role or db_owner database
role.
DBO is just a privileged user.
> 2. If I'm right with #1, then how come my user can't excute
> [dbo].[GetUserDataByEmail], instead I had to explicilty grant execute
> access to it?
If you memeber of syadmin server role or db_owner database role you don't
need EXECUTE permission
> 3. I see in another person's code, it had "GRANT EXECUTE on
> dbo.GetUserDataByEmail to public, what does public mean? anybody can
> execute it? if so, then what's the point of setting [dbo] to it?
Public means that every user can execute the sp , do you really want it
:-)))?
"Liming" <lmxudotnet@.gmail.com> wrote in message
news:1168466707.519839.206840@.77g2000hsv.googlegroups.com...
> Hi all,
> I have a sql account in a shared hosting server and my account is able
> to execute scripts to create [dbo].* tables and [dbo].* store
> procedures.
> however, after they are created, if I tried to execute them, I get for
> example,
> permission denied on object 'GetUserDataByEmail', database 'mypm',
> owner 'dbo'.
> so after googling around, I found out I had to do
> GRANT EXECUTE ON [dbo].[GetUserDataByEmail] TO 'myuser'
> then i could execute it.
> so i have these questions
> 1. I always thought in order to be able to create [dbo].* tables, you
> need to a dbo?
> 2. If I'm right with #1, then how come my user can't excute
> [dbo].[GetUserDataByEmail], instead I had to explicilty grant execute
> access to it?
> 3. I see in another person's code, it had "GRANT EXECUTE on
> dbo.GetUserDataByEmail to public, what does public mean? anybody can
> execute it? if so, then what's the point of setting [dbo] to it?
> Really appreicate your 2 cents on this. Thanks
>

No comments:

Post a Comment