Whenever I've needed to drop or alter objects in another database, I've used sp_ExecuteSQL:
This will fail:
DROP VIEW AdventureWorks.HumanResources.vEmployee
This will succeed:
EXEC [AdventureWorks].[sys].[sp_ExecuteSQL] N'DROP VIEW HumanResources.vEmployee'
commented on Dec 14 2011 6:55AM