I am trying to dynamically set the Database Name using a local variable...
I want to give access to a user to set the database name (New DBName Each Month) but not have access to the Script I'm writing... so I'm thinking the following
Declare @DBName nvarchar (255)
USE DBNameDatabase
Select @DBName = DBName From DBNameTable
Use @DBName
--Rest of script using @DBName as Database
Obviously doesn't work... any help would be appreciated
Thx
I want to give access to a user to set the database name (New DBName Each Month) but not have access to the Script I'm writing... so I'm thinking the following
Declare @DBName nvarchar (255)
USE DBNameDatabase
Select @DBName = DBName From DBNameTable
Use @DBName
--Rest of script using @DBName as Database
Obviously doesn't work... any help would be appreciated
Thx
Comment