Re: Stored Procedures in the Master Database

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


Date: Fri, 19 Sep 2003 09:05:39 -0700


The error occurs on a GRANT, not EXEC. GRANT can only be run on objects in
the current database.

--
HTH
----------------
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Sue Hoegemeier" <Sue_H@nomail.please> wrote in message
news:sj9mmvskgbu1n09hcla05osq071776ea08@4ax.com...
> Did you fully qualify the stored procedure when executing
> it? e.g.
> exec master.dbo.StoredProcedure
>
> -Sue
>
> On Fri, 19 Sep 2003 08:32:56 -0700, "Scott"
> <scott2617@hotmail.com> wrote:
>
> >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: Permission to Insert records for DB USERS
    ... To add to the response by Vyas, consider creating your own database ... EXEC sp_addrole 'Supervisors' ... GRANT SELECT ON MyTable TO Supervisors ... > I am a fresh developer for the SQL server and have no Idea> for the permissions on the database. ...
    (microsoft.public.sqlserver.security)
  • Re: Simple SQL Security Question From SQL Newbie
    ... >exec sp_grantdbaccess 'WIN2K\ASPNET' ... >VS.NET, I can use the server explorer and I can see the database, it's ... >login 'WebCalendar'. ... I also did a GRANT ALL on y2003 TO ASPNET ...
    (microsoft.public.sqlserver.security)
  • Re: Creating a view that uses a sp to retrive data
    ... Use Northwind ... And I still should qualify the database name. ... > db other than the stored procedure. ... exec tempdb..usp')x ...
    (microsoft.public.sqlserver.programming)
  • Re: Looping through databases in stored proc
    ... Yuu could try declaring and executing a string within your stored procedure ... select @str AS TheStringToExecute ... > dynamically run sp_helpfile against each database on the server. ... > exec sp_helpfile ...
    (microsoft.public.sqlserver.programming)
  • RE: Security context of stored procedure
    ... Suppose there are three users in a database TEST_CHAIN, ... simple stored procedure: ... also grant it to test_sp2 ... SELECT permission denied on object 'authors', database 'test_chain', owner ...
    (microsoft.public.sqlserver.security)

Loading