'Use  ' statement not executing T-SQL Okay, this seems funny for a simple script: but I really need this small piece to execute well.

DECLARE @dbName NVARCHAR(50)
SET @dbName = 'rx_lab'
DECLARE @SQL02 NVARCHAR(MAX)
SET @SQL02 = 'USE ['+ convert(nvarchar(50),@dbName) +']'
exec sp_executesql @SQL02

SELECT DB_NAME()


This still returns the 'master' database (instead of 'Rx_lab')
I have even tried using

exec ('use '+@dbName)


No change. It didn't work even without the conversion to nvarchar.
However, when I use 'USE [Rx_lab]' directly it returns well. This is part of stored procedure where the @dbName is main parameter.
sp_executesql creates a new execution context which ceases to exist when the executed statements return.  The USE only has effect within the sp_executesql.  Try this 

SET @SQL02 = 'USE ['+ convert(nvarchar(50),@dbName) +']; SELECT DB_NAME();'


and you'll get what you're after.