Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Equivalent of Set GUID for Procedures

Author  Topic 

sgtwilko
Starting Member

23 Posts

Posted - 2003-04-24 : 09:20:57
I have written a SP that calls system xp's.

The user that is calling the SP does not and should not have the rights to call the xp's normally, but I still need them to be able to run the SP.

Basically I looking for the same functionality that you have under unix where you can have a program run as the owner of the program not as the user that executed it (eg, a script could be owned by Root, and with the correct property set any user can run that, and it would run as Root, not as the user that was really running it).

Thanks

--
Eagles may soar,
but Weasels aren't sucked into jet engines.

nr
SQLTeam MVY

12543 Posts

Posted - 2003-04-24 : 09:30:24
The user will get rights from the login.
If he is given permission to run the sp then he should be able to run anything that that sp does - exceptions being cross database, dynamic sql or anything else that breaks the ownership chain - in which case user/login permissions will be checked.

You can get round this by running things under another connection as another login e.g. sa.
Methods of doing this include:
using a scheduled task started from the sp
openquery
osql


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

sgtwilko
Starting Member

23 Posts

Posted - 2003-04-24 : 11:27:23
quote:

The user will get rights from the login.
If he is given permission to run the sp then he should be able to run anything that that sp does - exceptions being cross database, dynamic sql or anything else that breaks the ownership chain - in which case user/login permissions will be checked.



Ok well as it is linking to another server that will not work as that's cross DB.

quote:

You can get round this by running things under another connection as another login e.g. sa.
Methods of doing this include:
using a scheduled task started from the sp
openquery
osql



I've tried getting the user to start a job, this fails as either the user can not see the job, or it runs as that user and still does not have permissions.

Running as another user would require storing the username/password of that user in an insecure place, wouldn't it?

I will investigate openquery and osql


--
Eagles may soar,
but Weasels aren't sucked into jet engines.
Go to Top of Page

sgtwilko
Starting Member

23 Posts

Posted - 2003-04-24 : 11:59:46
quote:

You can get round this by running things under another connection as another login e.g. sa.
Methods of doing this include:
using a scheduled task started from the sp
openquery
osql



I'm having problems understanding how I can use openquery. It seems to want to talk to a remote server not the local server. I've also looked at opendatasource and Openrowset. Opendatasource would appear to be what you were thinking of instead of openquery.

Is this correct?

Thanks

Ian

--
Eagles may soar,
but Weasels aren't sucked into jet engines.
Go to Top of Page
   

- Advertisement -