Solved

SQL Server 2005 Replication

Posted on 2009-04-08
5
203 Views
Last Modified: 2012-05-06
Hi,

We have two Servers on which we have implemented the Trasantional Replication and it works fine.
But still we have some unclear answers like Replcation is done from Server A to Server B.
Before doing the replication we generated the Server A Database script and ran on Server B, and IDENTITY INSERT was ON for all Tables along with Primary Keys.  Now Issue is that, we have TRANS table in the database  on which we perform inserts at server B.
So, at present (Server A)the current MIN(ID) is around 6000 and the MAX(ID)  approx  130000 in TRANS. If we are inserting data in TRANS table at server B, It starts the ID column from 1. and I affraid once the TRANS table ID column reaches to 6000, it can create some Issue.
Issues like can't  contain duplicate records.

Please advice,

With Regards,
0
Comment
Question by:sitg
  • 3
  • 2
5 Comments
 
LVL 60

Expert Comment

by:chapmandew
ID: 24115194
Sounds like your problem is that you don't have immediate updating subscribing enabled.  You have replication setup from A to B, but not from B to A also.  So, the changes you make at B will not get propogated to A.
0
 

Author Comment

by:sitg
ID: 24128188
Hi,

Actually we have TRANS table whose data is transferring from server A to Server B using Tracnsactional Replication(Using Primary Key). and For Example:
Server A TRANS table starts from ID 6 to 130000 which is  transferred to server B TRANS table (IDENTITY INSERT ON). SO server B TRANS also contains data from 6 to 130000.
Myquestion is: When we insert records in TRANS table of server B. It take ID column from 1.
and i believe that if this IDcolumn reach to 6000. it can create insertion problem. because it contains primary key on ID column.
0
 

Author Comment

by:sitg
ID: 24128232
Hi

Sorry, I did typo mistake,

Myquestion is: When we insert records in TRANS table of server B. It starts ID column from 1.
and i believe that if this IDcolumn reach to 6. it can create insertion problem. because it contains primary key on ID column.

We want whenever we insert records into TRANS table of server B, its ID column starts from the max(value) that was inserted during replication from server A. It should not start from 1. Please advice
0
 
LVL 60

Accepted Solution

by:
chapmandew earned 250 total points
ID: 24129305
Yeah, you're probably not going to be able to do that unless you
a.  programatically go find the highest value and then use
SET IDENTITY INSERT on for the table
b.  reseed the values on the B server.

Option a is your best bet.
0
 

Author Closing Comment

by:sitg
ID: 31568408
thanks, I was hoping the same. But now im sure about it. :-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now