April 16, 2008 at 2:15 am
Hi,
I have an issue with one of my production servers. I have a few production servers, and they all have the same objects. I do not want to create custom objects for each one, rather keep them all standard.
However, due to environment issues, I have one which does not have any linked servers.
I have a proc which queries either locally or across the linked server depending on the value of a switch. I want to install this proc on the server with no linked servers but it obviously fails.
I can guarantee the proc will never be called with the switch 'on' on that particular server. We still want to install this proc and call it with a switch of 0.
Please can somebody come up with something really clever.
The proc goes something like this:
CREATE PROC WhatEver @Switch int
AS
IF @Switch = 1
BEGIN
SELECT * FROM LinkedServer.Db.dbo.MyTable
END
ELSE BEGIN
SELECT * FROM dbo.MyTable
END
April 16, 2008 at 3:26 am
April 16, 2008 at 4:00 am
April 16, 2008 at 8:03 am
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply