Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment