hi all,
i know you can grant permission for function by the following code:
grant all on GetEmployeeName to user1
but how can I grant just SELECT permission on Function GetEmployeeName()?You cannot give SELECT permission on user-defined functions. Only thing
you can give is EXEC rights. Other workaround is create a view and give
SELECT permissions on it and call the view in the user defined function.|||GRANT SELECT ON ...
BG, SQL Server MVP
www.SolidQualityLearning.com
"Britney" <britneychen_2001@.yahoo.com> wrote in message
news:#ZlNypiNFHA.3928@.TK2MSFTNGP09.phx.gbl...
> hi all,
> i know you can grant permission for function by the following code:
> grant all on GetEmployeeName to user1
>
> but how can I grant just SELECT permission on Function GetEmployeeName()?
>|||Oops; I should be testing before suggesting. 8-)
BG, SQL Server MVP
www.SolidQualityLearning.com
"Itzik Ben-Gan" <itzik@.REMOVETHIS.SolidQualityLearning.com> wrote in message
news:#0Qx2ziNFHA.2748@.TK2MSFTNGP10.phx.gbl...
> GRANT SELECT ON ...
> --
> BG, SQL Server MVP
> www.SolidQualityLearning.com
>
> "Britney" <britneychen_2001@.yahoo.com> wrote in message
> news:#ZlNypiNFHA.3928@.TK2MSFTNGP09.phx.gbl...
GetEmployeeName()?
>|||You can grant execute permission on a function just like on a stored
procedure (a function is a type of sproc). Not sure if you can grant select
on a function. I tried with an error...
Richard
"Itzik Ben-Gan" <itzik@.REMOVETHIS.SolidQualityLearning.com> wrote in message
news:%230Qx2ziNFHA.2748@.TK2MSFTNGP10.phx.gbl...
> GRANT SELECT ON ...
> --
> BG, SQL Server MVP
> www.SolidQualityLearning.com
>
> "Britney" <britneychen_2001@.yahoo.com> wrote in message
> news:#ZlNypiNFHA.3928@.TK2MSFTNGP09.phx.gbl...
>|||Hi,
Give EXEC permission to the function.
GRANT EXECUTE ON FN_NAME to USER_NAME
Thanks
Hari
SQL Server MVP
____________________________________
Britney Wrote:
hi all,
i know you can grant permission for function by the following code:
grant all on GetEmployeeName to user1
but how can I grant just SELECT permission on Function GetEmployeeName()?
Sent via SreeSharp NewsReader http://www.SreeSharp.com|||Actually, you can if it's a table-valued one. You have to grant EXECUTE
permissions if it's a scalar one.
BG, SQL Server MVP
www.SolidQualityLearning.com
"Richard Ding" <rding@.acadian-asset.com> wrote in message
news:etrRY9jNFHA.3144@.tk2msftngp13.phx.gbl...
> You can grant execute permission on a function just like on a stored
> procedure (a function is a type of sproc). Not sure if you can grant
select
> on a function. I tried with an error...
>
> Richard
> "Itzik Ben-Gan" <itzik@.REMOVETHIS.SolidQualityLearning.com> wrote in
message
> news:%230Qx2ziNFHA.2748@.TK2MSFTNGP10.phx.gbl...
GetEmployeeName()?
>|||Actually, this scenario depends on the return type of the UDF. If the UDF
is a scalar valued function, the correct permission is EXECUTE. If the
function is table valued, the correct permission is SELECT. Refer to
http://msdn.microsoft.com/library/d...>
ity_5myb.asp
for more information regarding permissions on UDFs.
Assuming that the function is owned by dbo:
Table Valued
GRANT SELECT ON dbo.GetEmployeeName TO user
Scalar
GRANT EXECUTE ON dbo.GetEmployeeName TO user
HTH
--
Dave Fancher
http://davefancher.blogspot.com
"Hari Pra" <hari_pra_k@.hotmail.com> wrote in message
news:uozNfWkNFHA.1476@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Give EXEC permission to the function.
> GRANT EXECUTE ON FN_NAME to USER_NAME
> Thanks
> Hari
> SQL Server MVP
> ____________________________________
> Britney Wrote:
> hi all,
> i know you can grant permission for function by the following code:
> grant all on GetEmployeeName to user1
>
> but how can I grant just SELECT permission on Function GetEmployeeName()?
>
>
>
>
> Sent via SreeSharp NewsReader http://www.SreeSharp.com|||That clarifies it. Thanks.
"Itzik Ben-Gan" <itzik@.REMOVETHIS.SolidQualityLearning.com> wrote in message
news:eZrQxwkNFHA.2880@.TK2MSFTNGP10.phx.gbl...
> Actually, you can if it's a table-valued one. You have to grant EXECUTE
> permissions if it's a scalar one.
> --
> BG, SQL Server MVP
> www.SolidQualityLearning.com
>
> "Richard Ding" <rding@.acadian-asset.com> wrote in message
> news:etrRY9jNFHA.3144@.tk2msftngp13.phx.gbl...
> select
> message
> GetEmployeeName()?
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment