• Try this if it works:

    DECLARE @SQL_Upper as varchar(max)

    SET @SQL_Upper = UPPER('Select * from MyTable where myVar = ''RED''')

    Print(@SQL_Upper)