Showing posts with label company. Show all posts
Showing posts with label company. Show all posts

Friday, March 23, 2012

Moving tables between databases and setting alias

Due to bad programming techniques and legacy databases, my company has a large database with all the tables in it. I would like to start moving these tables out of the database and into more appropriately named databases.

I was wondering if there was a way to set an alias up so that, when the table is moved, there will be no problems with out code still trying to access the table from the old database.

Maybe an example is the best way to explain this. Lets say we have a DB_Company database with table T_Customers, T_Suppliers, etc.
Now, as the company grows, we decide to create a dedicated database for all the customers. So we create a database DB_Customers and move the T_Customers table into it.
The problem is that they may be some code that is still trying to access the DB_Company.T_Customers table. Is there a way of setting an alias up so that, when someone tries to access the DB_Company.T_ Customers table, he is automatically redirected to the DB_Customers.T_Customers?

Hope that's not too confusing :-(

Jag

Hi jagdipa,

I don't think (AFAIK) you can do an alias to the tables...But you can first check the db objects w/c depends on the table, by using the sp_depends '<tablename>' stored proc. and will display to you its dependencies.. and change as needed..

or

after getting the dependcies wrap the table into a view so that you don't need change the name in the dependencies..

HTH

|||Thanks Bonskijr, but that its not possible.

I am a great believer in using views and never accessing the tables directly. Unforuanetly, the people before me did not. There could be many pages that access the tables directly.

Edit: I just read your post properly. The second idea is very good. I will have a look into that. Thanks alot.

Wednesday, March 7, 2012

Moving production site

Hi there,
My company is in the process of moving our location into a new data
center. The operation is 24x7 and ideally the move would involve no or
very little downtime. The setup is Windows 2003 Ent running SQL Server
2000 in Active/Passive cluster with EMC SAN being replicated via XOSoft
to DR site. At this time all options are being considered including
third party products. Any info is greatly appreciated.
ThanksHi
http://vyaskn.tripod.com/moving_sql_server.htm
<boblotz2001@.yahoo.com> wrote in message
news:1169147672.259821.149060@.s34g2000cwa.googlegroups.com...
> Hi there,
> My company is in the process of moving our location into a new data
> center. The operation is 24x7 and ideally the move would involve no or
> very little downtime. The setup is Windows 2003 Ent running SQL Server
> 2000 in Active/Passive cluster with EMC SAN being replicated via XOSoft
> to DR site. At this time all options are being considered including
> third party products. Any info is greatly appreciated.
> Thanks
>

Moving production site

Hi there,
My company is in the process of moving our location into a new data
center. The operation is 24x7 and ideally the move would involve no or
very little downtime. The setup is Windows 2003 Ent running SQL Server
2000 in Active/Passive cluster with EMC SAN being replicated via XOSoft
to DR site. At this time all options are being considered including
third party products. Any info is greatly appreciated.
ThanksHi
http://vyaskn.tripod.com/moving_sql_server.htm
<boblotz2001@.yahoo.com> wrote in message
news:1169147672.259821.149060@.s34g2000cwa.googlegroups.com...
> Hi there,
> My company is in the process of moving our location into a new data
> center. The operation is 24x7 and ideally the move would involve no or
> very little downtime. The setup is Windows 2003 Ent running SQL Server
> 2000 in Active/Passive cluster with EMC SAN being replicated via XOSoft
> to DR site. At this time all options are being considered including
> third party products. Any info is greatly appreciated.
> Thanks
>