DECLARE @current_bind varchar(30) SET @current_bind = 'tempdb_large_01' DECLARE @set_tempdb varchar(30) SET @set_tempdb = 'blub' CASE WHEN @current_bind='tempdb_large_01' then SET @set_tempdb = 'tempdb_large_02' WHEN @current_bind='tempdb_large_02' then SET @set_tempdb = 'tempdb_large_03' WHEN @current_bind='tempdb_large_03' then SET @set_tempdb = 'tempdb_large_01' ELSE SET @set_tempdb = 'blub' END print 'current: %1! - set: %2!', @current_bind, @set_tempdb go DECLARE @current_bind varchar(30) SET @current_bind = 'tempdb_large_01' DECLARE @set_tempdb varchar(30) SET @set_tempdb = 'blub' IF @current_bind='tempdb_large_01' BEGIN SET @set_tempdb = 'tempdb_large_02' END IF @current_bind='tempdb_large_02' BEGIN SET @set_tempdb = 'tempdb_large_03' END IF @current_bind='tempdb_large_03' BEGIN SET @set_tempdb = 'tempdb_large_01' END print 'current: %1! - set: %2!', @current_bind, @set_tempdb go