I wrote the following code:
Declare @DaataBaseName2 varchar(50)
set @DaataBaseName2 = 'LUNDB14644A01' -- @DaataBaseName
USE @DaataBaseName2 --LUNDB14644A01
GO
I received following error:
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '@DaataBaseName2'.
Why?