View difference between Paste ID: L75m7feH and MXtaZ2Ym
SHOW: | | - or go back to the newest paste.
1
DECLARE @current_bind varchar(30)
2
SET @current_bind = 'tempdb_large_01'
3
DECLARE @set_tempdb varchar(30)
4
SET @set_tempdb = 'blub'
5
6
CASE WHEN @current_bind='tempdb_large_01' then SET @set_tempdb = 'tempdb_large_02'
7
			WHEN @current_bind='tempdb_large_02' then SET @set_tempdb = 'tempdb_large_03'
8
			WHEN @current_bind='tempdb_large_03' then SET @set_tempdb = 'tempdb_large_01'
9
		ELSE SET @set_tempdb = 'blub'
10
		END
11
12
print 'current: %1! - set: %2!', @current_bind, @set_tempdb
13
go
14
DECLARE @current_bind varchar(30)
15
SET @current_bind = 'tempdb_large_01'
16
DECLARE @set_tempdb varchar(30)
17
SET @set_tempdb = 'blub'
18
19
IF @current_bind='tempdb_large_01' BEGIN SET @set_tempdb = 'tempdb_large_02' END
20
IF @current_bind='tempdb_large_02' BEGIN SET @set_tempdb = 'tempdb_large_03' END
21
IF @current_bind='tempdb_large_03' BEGIN SET @set_tempdb = 'tempdb_large_01' END
22
23
print 'current: %1! - set: %2!', @current_bind, @set_tempdb
24
go