Hi,
Have a stored procedure that accesses data via a linked server. Whilst testing we point to a test linked server and then change the procedure to a different one when it goes live. Not ideal.
Was wondering if there's a way to conditionally select the the linked server, sort of like this but a bit more elegantly.
IF (@Debug =1) BEGIN SELECT * FROM [DebugServer].[DB].dbo.table; END ELSE BEGIN SELECT * FROM [LiveServer].[DB].dbo.table; END