I'm trying to create a stored procedure on my master database that I can query other databases. The reason behind putting it on the master db is so I will have one place to modify the stored procedure instead of potentially a hundred different databases. I am trying to create a stored procedure like the one below, but it seems to not like it and I get the error below. Any suggestions are appreciated.DECLARE @uName AS nvarchar(30), @dbName as nvarchar(5)SET @uName='TU'SET @dbName = '00000'DELETE FROM [DASHDB].[dbo].users WHERE Username=@uNameEXECUTE('USE ['+@dbName+']')DELETE FROM DashboardBranches WHERE Username=@uNameDELETE FROM MyDashboardSettings WHERE Username=@uNameDELETE FROM MyFavorites WHERE Username=@uNameDELETE FROM MyModules WHERE Username=@uNameDELETE FROM MyStocks WHERE Username=@uNameDELETE FROM BoardPackage WHERE PackageID IN (SELECT ID FROM BPackages WHERE Username=@uName)DELETE FROM BPackages WHERE Username=@uName
ERROR:Msg 208, Level 16, State 1, Line 6Invalid object name 'DashboardBranches'.Thanks,Josh