I am using the same view (for 140 individual tables) across multiple copies of the same database (each with different names on 6 different servers). I need a way to generically reference a server and/or database name within a view. I am open to any technique that will work within a view and would resolve at run-time.
Example 1:
create view dbo.MyTrans
as
select * from @server.@dbname.dbo.transactions
Example 1:
create view dbo.MyTrans
as
select * from @dbname1.dbo.transactions as t
inner join @dbname2.dbo.control as c
on t.appid = c.appid
Note: I only use select * as an example; I am using named columns in the actual views.
Jim Kraxberger
Developing Access solutions since 1995
jkraxberger@scp4me.com
Example 1:
create view dbo.MyTrans
as
select * from @server.@dbname.dbo.transactions
Example 1:
create view dbo.MyTrans
as
select * from @dbname1.dbo.transactions as t
inner join @dbname2.dbo.control as c
on t.appid = c.appid
Note: I only use select * as an example; I am using named columns in the actual views.
Jim Kraxberger
Developing Access solutions since 1995
jkraxberger@scp4me.com