EXEC in stored procedure

From: Magnus Blomberg (magnus.blomberg_at_skanska.se)
Date: 10/26/04


Date: Tue, 26 Oct 2004 19:12:30 +0200

Hello!

I'm trying to use
   EXEC ('SELECT * FROM Categories')
into a Stored Procedure, but the users get permission denied on object
'Categories'
If I'm using
   SELECT * FROM Categories
everything works.
The user haven't any permission of Categories, but the SP should have it.

Is the EXEC command inside the SP run as the user? Why?

Regards Magnus



Relevant Pages

  • Re: noise words, @@ERROR, and stop and resume indexing
    ... EXEC sp_fulltext_catalog 'adsfull', 'stop' ... > 1) check noise words inside stored procedure ... > can be solved by changing the language specific file with noise words ... ...
    (microsoft.public.sqlserver.fulltext)
  • source text file as input parameter from a stored procedure
    ... I am using an active X script in combination with a global ... transform task that loads data from a .txt file to a table. ... I can also tell that the stored procedure is correctly passing in the ... EXEC sp_OAGeterrorinfo @object, @hr ...
    (microsoft.public.sqlserver.dts)
  • Re: Repeating 3 Datapump actions between the same datasource/destinati
    ... How to loop through a global variable Rowset ... > exec p_PullDataForDates1 20050101,20050131 ... > task that configure the SourceSQLStatement for the 2 pumps (to fill in the ... > blanks for the stored procedure parameter). ...
    (microsoft.public.sqlserver.dts)
  • Re: Stored Procedure Fails Only When Called By Agent
    ... Stored Procedure 1: ... EXEC sp_addlinkedserver '10.1.2.10', 'SQL Server' ... LOCALMACHINE\myaccount/pass3, the same account that owns the job. ...
    (microsoft.public.sqlserver.replication)
  • Re: Please Help
    ... Remember, he wants to do this in a stored procedure, thus preventing the use ... exec sp_addlogin @user,@user ... > --create new sql login ... > --add to pubs datareader role ...
    (microsoft.public.sqlserver.security)