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 |
vanisa
Starting Member
10 Posts |
Posted - 2009-08-19 : 03:12:27
|
Hi All, I want to update the table from one database(let say 172.16.3.35) to table in other database(172.16.3.225).1.For this i created a Linked server in Enterprise Manager.2.Enabled MSDTC to allow the network transaction.3.Configured Windows Firewall to include the MSDTC program and to include port 135 as an exceptionNow using the trigger i want to update my table in 172.16.3.225.But Am getting the Follwing errorServer: Msg 7391, Level 16, State 1, Procedure Updateusername, Line 6The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]Please Help Me out.This is very Urgent |
|
Ali.M.Habib
Yak Posting Veteran
54 Posts |
Posted - 2009-08-19 : 03:21:05
|
check your connection string |
|
|
vanisa
Starting Member
10 Posts |
Posted - 2009-08-19 : 03:26:26
|
quote: Originally posted by Ali.M.Habib check your connection string
You mean to say the Linked Server name??? Using that connection name Am able to execute the select queries..while trying to update i got the posted error.. |
|
|
Ali.M.Habib
Yak Posting Veteran
54 Posts |
Posted - 2009-08-19 : 03:36:04
|
quote: Originally posted by vanisa
quote: Originally posted by Ali.M.Habib check your connection string
You mean to say the Linked Server name??? Using that connection name Am able to execute the select queries..while trying to update i got the posted error..
No , when you connect you use EXEC sp_addlinkedserver @server = linkedserver_name, @srvproduct = '',@provider = 'MSDASQL',@provstr = 'DRIVER={SQL Server};SERVER=1.1.1.1;User ID=xxx;Password=xxxx'then u should start the trigger by sp_addlinkedsrvlogin 'linkedserver_name', 'false', NULL, 'xxx', 'xxxx' this is so important to start the server |
|
|
vanisa
Starting Member
10 Posts |
Posted - 2009-08-19 : 04:07:43
|
quote: Originally posted by Ali.M.Habib
quote: Originally posted by vanisa
quote: Originally posted by Ali.M.Habib check your connection string
You mean to say the Linked Server name??? Using that connection name Am able to execute the select queries..while trying to update i got the posted error..
No , when you connect you use EXEC sp_addlinkedserver @server = linkedserver_name, @srvproduct = '',@provider = 'MSDASQL',@provstr = 'DRIVER={SQL Server};SERVER=1.1.1.1;User ID=xxx;Password=xxxx'then u should start the trigger by sp_addlinkedsrvlogin 'linkedserver_name', 'false', NULL, 'xxx', 'xxxx' this is so important to start the server
Thanks, But i could not trace out pls help meI created a new linked server as you said,coding am placing for ur verification. EXEC sp_addlinkedserver @server = van1, @srvproduct = 'SQL 2000',@provider = 'Microsoft OLE DB provider for SQL SERVER',@provstr = 'DRIVER={SQL Server};SERVER=172.16.3.225;User ID=sa;Password=laser'then, i executed thissp_addlinkedsrvlogin 'van1', 'false', NULL, 'sa', 'laser' The following proc i want to execute1.linktab1 is the table in 172.16.0.35 in which i executed the add linkecd server query.2.linktab2 is the table in 172.16.3.225using the below trigger i want to update the table in 172.16.3.225server.create trigger Updateusernameon linktab1after updateasprint 'trigger UpdateUserName - executed'update KIRTHIKA.Scdevelopment.dbo.linktab2 set empname='kirthika' where userid=1After this update statement in 35 server the above trigger should be executed.update linktab1 set empname='jo' where userid=1 |
|
|
Ali.M.Habib
Yak Posting Veteran
54 Posts |
Posted - 2009-08-19 : 04:19:34
|
quote: Originally posted by vanisa
quote: Originally posted by Ali.M.Habib
quote: Originally posted by vanisa
quote: Originally posted by Ali.M.Habib check your connection string
You mean to say the Linked Server name??? Using that connection name Am able to execute the select queries..while trying to update i got the posted error..
No , when you connect you use EXEC sp_addlinkedserver @server = linkedserver_name, @srvproduct = '',@provider = 'MSDASQL',@provstr = 'DRIVER={SQL Server};SERVER=1.1.1.1;User ID=xxx;Password=xxxx'then u should start the trigger by sp_addlinkedsrvlogin 'linkedserver_name', 'false', NULL, 'xxx', 'xxxx' this is so important to start the server
Thanks, But i could not trace out pls help meI created a new linked server as you said,coding am placing for ur verification. EXEC sp_addlinkedserver @server = van1, @srvproduct = 'SQL 2000',@provider = 'Microsoft OLE DB provider for SQL SERVER',@provstr = 'DRIVER={SQL Server};SERVER=172.16.3.225;User ID=sa;Password=laser'then, i executed thissp_addlinkedsrvlogin 'van1', 'false', NULL, 'sa', 'laser' The following proc i want to execute1.linktab1 is the table in 172.16.0.35 in which i executed the add linkecd server query.2.linktab2 is the table in 172.16.3.225using the below trigger i want to update the table in 172.16.3.225server.create trigger Updateusernameon linktab1after updateasprint 'trigger UpdateUserName - executed'update KIRTHIKA.Scdevelopment.dbo.linktab2 set empname='kirthika' where userid=1After this update statement in 35 server the above trigger should be executed.update linktab1 set empname='jo' where userid=1
try this :create trigger Updateusernameon linktab1after updateasprint 'trigger UpdateUserName - executed'updatelinkedservername.dbname.schema(owner in sql server 2000).linktab2 set empname='kirthika' where userid=1use the sequence |
|
|
vanisa
Starting Member
10 Posts |
Posted - 2009-08-19 : 04:53:02
|
quote: Originally posted by Ali.M.Habib
quote: Originally posted by vanisa
quote: Originally posted by Ali.M.Habib
quote: Originally posted by vanisa
quote: Originally posted by Ali.M.Habib check your connection string
You mean to say the Linked Server name??? Using that connection name Am able to execute the select queries..while trying to update i got the posted error..
No , when you connect you use EXEC sp_addlinkedserver @server = linkedserver_name, @srvproduct = '',@provider = 'MSDASQL',@provstr = 'DRIVER={SQL Server};SERVER=1.1.1.1;User ID=xxx;Password=xxxx'then u should start the trigger by sp_addlinkedsrvlogin 'linkedserver_name', 'false', NULL, 'xxx', 'xxxx' this is so important to start the server
Thanks, But i could not trace out pls help meI created a new linked server as you said,coding am placing for ur verification. EXEC sp_addlinkedserver @server = van1, @srvproduct = 'SQL 2000',@provider = 'Microsoft OLE DB provider for SQL SERVER',@provstr = 'DRIVER={SQL Server};SERVER=172.16.3.225;User ID=sa;Password=laser'then, i executed thissp_addlinkedsrvlogin 'van1', 'false', NULL, 'sa', 'laser' The following proc i want to execute1.linktab1 is the table in 172.16.0.35 in which i executed the add linkecd server query.2.linktab2 is the table in 172.16.3.225using the below trigger i want to update the table in 172.16.3.225server.create trigger Updateusernameon linktab1after updateasprint 'trigger UpdateUserName - executed'update KIRTHIKA.Scdevelopment.dbo.linktab2 set empname='kirthika' where userid=1After this update statement in 35 server the above trigger should be executed.update linktab1 set empname='jo' where userid=1
try this :create trigger Updateusernameon linktab1after updateasprint 'trigger UpdateUserName - executed'updatelinkedservername.dbname.schema(owner in sql server 2000).linktab2 set empname='kirthika' where userid=1use the sequence
I used as u said but i got the error as belowServer: Msg 7403, Level 16, State 1, Procedure Updateusername, Line 6Could not locate registry entry for OLE DB provider 'Microsoft OLE DB provider for SQL SERVER'. |
|
|
Ali.M.Habib
Yak Posting Veteran
54 Posts |
Posted - 2009-08-19 : 05:19:29
|
quote: Originally posted by vanisa
quote: Originally posted by Ali.M.Habib
quote: Originally posted by vanisa
quote: Originally posted by Ali.M.Habib
quote: Originally posted by vanisa
quote: Originally posted by Ali.M.Habib check your connection string
You mean to say the Linked Server name??? Using that connection name Am able to execute the select queries..while trying to update i got the posted error..
No , when you connect you use EXEC sp_addlinkedserver @server = linkedserver_name, @srvproduct = '',@provider = 'MSDASQL',@provstr = 'DRIVER={SQL Server};SERVER=1.1.1.1;User ID=xxx;Password=xxxx'then u should start the trigger by sp_addlinkedsrvlogin 'linkedserver_name', 'false', NULL, 'xxx', 'xxxx' this is so important to start the server
Thanks, But i could not trace out pls help meI created a new linked server as you said,coding am placing for ur verification. EXEC sp_addlinkedserver @server = van1, @srvproduct = 'SQL 2000',@provider = 'Microsoft OLE DB provider for SQL SERVER',@provstr = 'DRIVER={SQL Server};SERVER=172.16.3.225;User ID=sa;Password=laser'then, i executed thissp_addlinkedsrvlogin 'van1', 'false', NULL, 'sa', 'laser' The following proc i want to execute1.linktab1 is the table in 172.16.0.35 in which i executed the add linkecd server query.2.linktab2 is the table in 172.16.3.225using the below trigger i want to update the table in 172.16.3.225server.create trigger Updateusernameon linktab1after updateasprint 'trigger UpdateUserName - executed'update KIRTHIKA.Scdevelopment.dbo.linktab2 set empname='kirthika' where userid=1After this update statement in 35 server the above trigger should be executed.update linktab1 set empname='jo' where userid=1
try this :create trigger Updateusernameon linktab1after updateasprint 'trigger UpdateUserName - executed'updatelinkedservername.dbname.schema(owner in sql server 2000).linktab2 set empname='kirthika' where userid=1use the sequence
I used as u said but i got the error as belowServer: Msg 7403, Level 16, State 1, Procedure Updateusername, Line 6Could not locate registry entry for OLE DB provider 'Microsoft OLE DB provider for SQL SERVER'.
see this link http://forums.asp.net/t/1149643.aspx may help u |
|
|
vanisa
Starting Member
10 Posts |
Posted - 2009-08-19 : 05:31:45
|
Thanks,EXEC sp_addlinkedserver @server = kirthics, @srvproduct = '',@provider = 'SQLOLEDB', @provstr = 'DRIVER={SQL Server};SERVER=172.16.3.225;User ID=sa;Password=laser'sp_addlinkedsrvlogin 'kirthics', 'false', NULL, 'sa', 'laser' create trigger Updateusernameon linktab1after updateasprint 'trigger UpdateUserName - executed'update kirthics.Scdevelopment.dbo.linktab2 set empname='kirthika' where userid=1Now i executed as u said...All the queries executed successfullyand the trigger is also created successfully.But when i update below statement,Am getting back the same error. update linktab1 set empname='kir' where userid=1Error:Server: Msg 7391, Level 16, State 1, Procedure Updateusername, Line 6The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]But i can execute insert queries and select queriees and all.Only Update i can't execute. |
|
|
|
|
|
|
|