From: SetonSoftware on
On Jun 18, 3:55 pm, John Bell <jbellnewspo...(a)hotmail.com> wrote:
> On Fri, 18 Jun 2010 06:44:17 -0700 (PDT), SetonSoftware
>
>
>
>
>
> <seton.softw...(a)verizon.net> wrote:
> >We have a number of stored procs/functions in a support databse which
> >looks to a production database for the data. Rather than do this in
> >each procedure:
>
> >SELECT col1 FROM ProdServer.dbo.MyTable
>
> >We were hoping to create a synonym, say SourceDB, for ProdServer.dbo
> >and prepend it to the table name like this:
>
> >SELECT col1 FROM SourceDB.MyTable
>
> >Then we can easily change the data source simply by changing the
> >synonym.
>
> >Unfortunately this doesn't work. I've only been able to create a
> >synonym that points to a specific databse object but that means I need
> >to create and maintain one synonym for each object. Is there any way
> >to do what I'm asking?
>
> >Thanks
>
> >Carl
>
> How about using views?
>
> John- Hide quoted text -
>
> - Show quoted text -

Unfortunately, views won't work here. They would result in the same
limitation as synonyms.

Carl
First  |  Prev  | 
Pages: 1 2
Prev: recursive call in TSQL
Next: Trigger Syntax