forecasting
Programmer
- May 2, 2002
- 130
I have two databases in the same instance of SQL Server, DB1 and DB2. I connect to each database with a separate login that is not shared between databases (login1 for DB1 and login2 for DB2). When running a particular stored procedure on DB2 I want to insert a record on DB1. I can do this with a linked server, but I want to know if it is possible to by changing my connection string. For example,
select name from DB1..Users where (unique = 1)
(CHANGE connection)
insert into DB2..UserID (IDname) values (name)
select name from DB1..Users where (unique = 1)
(CHANGE connection)
insert into DB2..UserID (IDname) values (name)