I've got this t-sql snippet:
DECLARE @db_name varchar(255);
SET @db_name = 'MY_DATABASE'; -- assuming there is database called 'my_database'
USE @db_name -- this line ends with error "Incorrect syntax near '@db'."
But USE with variable (third line of snippet) doesn't work. Why it doesn't work?