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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-07-12 : 09:09:05
|
| mitesh writes "hi,How do you Delete a Stored Procedure from a different database.Say you have DB1 owned by USER1 and DB2 owned by USER2 and DBMain owned by the DBO.User1 & User2 are able to execute StoredProcedures that sit in DBMain. I want to write a stored procedure that will sit in DBMain, but when called by USER1 or USER2, will delete a given storedProcedure in their Database.Im using DBMain to control my application, it contains all the stored procedures. Its a Web-Front End to allow creation of tables etc.... Hope this makes things more clear.Thanks in advance!" |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2002-07-14 : 09:30:29
|
| exec db2..sp_executesql('drop procedure procname')whether or not it works will depend on whether the user has permission to drop the SP and there's no way round that (probably not).The only other option is to create a new connection with a user which does have the permission using openquery or openrowset or osql.This is a bit of an odd thing to want to do though - you might trying rethinking the design.==========================================Cursors are useful if you don't know sql.Beer is not cold and it isn't fizzy.Edited by - nr on 07/14/2002 09:31:57 |
 |
|
|
|
|
|