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.
| Author |
Topic |
|
cwfontan
Yak Posting Veteran
87 Posts |
Posted - 2008-08-26 : 08:53:26
|
| I would like to know how/ i can create a trigger to update column upon insert to retrieve data from another server.DB ? ?this is just a stab at what im trying to accomplish?????????????????????????update table set userName = (SELECT userName FROM server2.db.users WHERE server1.db.userId = server2.db.userID)???????????????????????? |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-08-26 : 09:58:27
|
Yes you can, but it can perform very badly and even timeout, thus rollbacking the current statement.UPDATE tSET t.UserName = x.UserNameFROM Table AS tINNER JOIN inserted AS i ON i.UserID = t.UserIDLEFT JOIN Server2.db.Users AS x ON x.UserID = t.UserID E 12°55'05.25"N 56°04'39.16" |
 |
|
|
cwfontan
Yak Posting Veteran
87 Posts |
Posted - 2008-08-26 : 10:13:29
|
| thank you very much.. also had to use the sp_addlinkedserver [server] |
 |
|
|
|
|
|