Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Table reference to another DB instance?

Author  Topic 

lartsi
Starting Member

2 Posts

Posted - 2008-04-13 : 11:16:48
Hello everyone,

this would be my first posting.

I would like to know if it's possible in MS SQL to redirect a table into another DB instance? I have no access into the source code and I have been wondering if it is possible to make a redirection/hard link in MS SQL side.

I would have a table in my base DB and when a query is made into this table, the MS SQL would redirect it to another DB or table. Is this possible in MS SQL ? Something along the lines of a hard-link in linux.
Thank you very much.

nr
SQLTeam MVY

12543 Posts

Posted - 2008-04-13 : 11:23:14
You can create a view with the table name
create view tablename
as
select * from myotherdb.dbo.tablename
go

It may cause problems with the backup strategy though.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

lartsi
Starting Member

2 Posts

Posted - 2008-04-13 : 14:49:42
This is a very interesting idea and a good one at that. I will try how this would actually work in our DB queries. Backup is no problem since this view would be used to minimize the amount of backup for old data in production DB. Thank you very much.
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2008-04-13 : 16:13:15
Also have a look at partitioned tables. Although this is more complicated you can split your table into active and static partitions.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -