Closed wibeasley closed 7 years ago
The below sql should work
DECLARE @database_name nvarchar(255); SET @database_name = '[go_round_in_circles]' DECLARE @use nvarchar(max); SET @use = 'USE ' + @database_name print 'database use : ' + @use EXEC ( @use + ';' + 'any other statements to execute')
I have also emailed the sql for the above more descriptively ,Im closing this issue please let me know if you need this to be reopened.
@mand9472, please figure out a way to do the
USE
statement w/ variables.Instead of
Something like this (although this doesn't work):
Here are two possible helpers: