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)
 T-SQL Connection statement

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-28 : 08:43:44
Eric writes "I have been checking everywhere and may be I am wording it incorectly. I am trying to find information about entering a command line statement to connect to the databse ans another user.

Here is what I am doing.
I am running a web page which calls a stored procedure. When connected through the web page I am using the basic user account with only public privs. I am calling a stored procedure which I can execute no problem, however there are commands in the stored proc such as CREATE & DROP TABLE that basic user does not have privs for and I do not want to grant these privs. What I would like to do is when the stored proc kicks off I would like to include a connect statement to connect as the dbo to run the remainder of the stored proc then log out of the dbo and return as basic user when completed.

Any help would be appreciated.

Thanks

Eric"

setbasedisthetruepath
Used SQL Salesman

992 Posts

Posted - 2002-05-28 : 16:38:05
All you have to do is grant EXECUTE on the procedure to the web user. The web user doesn't need permissions to perform the dml/ddl in the proc, as long as the owner of the proc does.

Read up on ownership chains in BOL for more.

quote:

Eric writes "I have been checking everywhere and may be I am wording it incorectly. I am trying to find information about entering a command line statement to connect to the databse ans another user.

Here is what I am doing.
I am running a web page which calls a stored procedure. When connected through the web page I am using the basic user account with only public privs. I am calling a stored procedure which I can execute no problem, however there are commands in the stored proc such as CREATE & DROP TABLE that basic user does not have privs for and I do not want to grant these privs. What I would like to do is when the stored proc kicks off I would like to include a connect statement to connect as the dbo to run the remainder of the stored proc then log out of the dbo and return as basic user when completed.

Any help would be appreciated.

Thanks

Eric"



setBasedIsTheTruepath
<O>
Go to Top of Page
   

- Advertisement -