Re: Stored Procedures in the Master Database

From: Kalen Delaney (replies_at_public_newsgroups.com)
Date: 09/19/03


Date: Fri, 19 Sep 2003 10:34:04 -0700


GRANTS must be done in the local database.

So what exactly is not working. The GRANT or the EXECUTE? The message you
reported means the object can't be found and can be caused by not
specifying the correct owner name. That message cannot be the result of
wrong permissions or ungranted permissions.

Please tell us EXACTLY what you did and what database you were in when you
tried to run it.

--
HTH
----------------
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Scott" <scott2617@hotmail.com> wrote in message
news:87d901c37ecc$3ce19230$a601280a@phx.gbl...
> I am creating the procedure under the security context of
> sa in the master database. I tried qualifying the grant
> statement with dbo.proc_name and executing in another
> database and it did not work.
>
> >-----Original Message-----
> >Who owns the procedure?
> >
> >If you are indeed in the master database when you run
> this GRANT, and the
> >procedure is in master, then the reason is probably that
> the owner of the
> >proc must be specified. If it's not yours, you have to
> list the owner:
> >
> >GRANT EXECUTE ON owner_name.proc_name TO public
> >--
> >HTH
> >----------------
> >Kalen Delaney
> >SQL Server MVP
> >www.SolidQualityLearning.com
> >
> >
> >"Scott" <scott2617@hotmail.com> wrote in message
> >news:00c001c37ec3$4c76ea50$a301280a@phx.gbl...
> >> I have a stored procedure that I want to make available
> to
> >> all databases. I am trying to grant permissions with the
> >> following command in the master database:
> >>
> >> GRANT EXECUTE ON storedprocedure TO public
> >>
> >> When I try to execute the stored procedure from another
> >> database I get the error message:
> >>
> >> Server: Msg 2812, Level 16, State 62, Line 1
> >> Could not find stored procedure 'storedprocedure'.
> >>
> >> Please advise on the correct syntax.
> >>
> >
> >
> >.
> >


Relevant Pages

  • Re: Quick code to execute an SQL stored procedure.
    ... There are alot of post where people don't google for an answer, ... But you are right I googled for "MFC Stored Procedure In 3 Lines of Code" ... I figured that a stored procedure is like a function call to a database. ... I'd use the handle and then call some kind of execute ...
    (microsoft.public.vc.mfc)
  • Re: Grant Execute right to the group of users
    ... Below is a script that will grant execute permissions to the specified role ... on all user procedures in the current database. ... > How could I grant the execute right to all stored procedures in a database for a group of users? ...
    (microsoft.public.sqlserver.programming)
  • Re: Execute stored procedure only
    ... You need CONNECT capability to be able to get into the database and execute ... You can compare this to having permission to eat a piece of pie, ... Should I not be able to just execute SP through QA? ... right to execute stored procedure in database called "mydatabase". ...
    (microsoft.public.sqlserver.security)
  • Re: Logon failed for user ". but only for membership tables in same database that other request wor
    ... I was able to log on to computer b and execute the stored procedure. ... was no error after I corrected the permissions for the user. ... I can access the stored procedure but I can not use membership.validateuser. ... You may use the GRANT statement to grant the EXECUTE permission for a ...
    (microsoft.public.sqlserver.security)
  • Re: Stored Procedures in the Master Database
    ... The error occurs on a GRANT, not EXEC. ... >>I have a stored procedure that I want to make available to ... >>following command in the master database: ...
    (microsoft.public.sqlserver.security)