.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

How to synchronize two tables in two different servers where primary key is auto numbered?

Posted By: Jean Paul     Posted Date: September 29, 2010    Points:2   Category :Sql Server
I have a table EmployeeTable in two different servers.
How to synchronize first server with the values in second server.

Constraint: Id column ins auto number.

-- sql
CREATE TABLE [dbo].[EmployeeTable](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [PK_EmployeeTable] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO



Responses
Author: Deco             
Posted Date: October 02, 2010     Points: 5   

INSERT INTO EmployeeTable(Name) --Server1
SELECT Name FROM OPENROWSET ('SQLNCLI10','Server=servername;Uid=userID;pwd=Password',
'SELECT Name FROM EmployeeTable') -- Server2



Regards,
Deco


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend