January 12, 2007 at 8:44 am
I am working on a project and I need some help. The idea is to move two tables from an existing database to another database on the same server. I can use the DTS wizard to copy the tables over to the new database, but what else is required to complete the process as far as stored procedures and any others pointing at the existing database?
January 12, 2007 at 8:56 am
Are you looking to have all stored procedures in the original database (dbA) access the tables in the new databases (dbB) and the tables will be deleted from dbA?
You need to manually point the procedures, views, functions, etc. to the new database. You can do this with four part naming (not recommended) by referencing the tables like this.
insert into dbB.dbo.TableA
The other way is to create a view in dbA that points to the table in dbB. So if the table being moved is Sales, then move it to dbB. Then run this
create view Sales
as
select colA
, colB
...
from dbB.dbo.Sales
and that way you don't need to update code.
January 15, 2007 at 2:55 pm
Hi Thomas
Why do you want to move two tables from database A to database B if you need to reference them with stored procedure from database A.
If the data is part of the same system, keep them in the same database.
What is the reason for your action?
/Morten
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply