A couple of additional pieces of information would be helpful. When
defining the merge article are you using the @auto_identity_range set to
'true' or 'false' (default)? When defining the merge subscription, are you
using @sync_type='none' or 'automatic' (default).
Based on what I see below, the following should work to set up odd values on
the publisher and even values on the subscriber. A possible solution
requires you to manually manage the identity values on both sides and it
will require the merge subscription to use the No Sync feature --
@sync_type='none'.
Create your DB1 (publisher) and DB2 (subscriber) databases. Create the
table in both databases, identity (1,2) in DB1 and identity (2,2) in DB2.
Make sure you also define the Rowguid column in both tables as well. This
is required by merge.
create table t1 (
Column1 int identity (1,2) NOT FOR REPLICATION,
Column2 varchar(100),
rowguid uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT
[DF__t1__rowguid__74AE54BC] DEFAULT (newid()))
go
It looks like the merge subscription in your original scenario is set to
'automatic', so the merge agent will reseed the subscriber upon the first
merge while applying the initial snapshot. You need to use
@sync_type='none' for the merge subscription. This will prevent the merge
agent from reapplying the publisher table at the subscriber and thus
maintain your identity (2,2) on the subscriber. You need to initially
populate the subscriber database.
A drawback to watch out for is that you will have a difficult time adding
more subscribers to your replicaiton topolgy because only odd and even
numbers are allowed. If more subscribers are needed, you may need to break
this down and start over.
Another drawback is that the @sync_type option is set at the subscription
level. This means all articles in the publication pointed to that
subscription are in No Sync mode. You would have to initially sync all
articles manually. A workaround for this would be to create two
publications, one with your identity table using a No Sync subscription and
another publication with all other articles that sync automatically.
Please read through the following topic in SQL 2000 BOL -- "Managing
Identity Values". If you can conform to the requirements of the automatic
identity range management it may be a better solution for you going forward.
Instead of using odd and even numbers, your would use different ranges of
identity values on the publisher and subscriber.
--
Sincerely,
Tom Michaels
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
[quoted text, click to view] "Asad Imam" <asadimam@hotmail.com> wrote in message
news:uSM2VgAgDHA.3104@TK2MSFTNGP11.phx.gbl...
> Biggest Problem (Very imp scenario for all of u, u must aware of
> this....problem in sql server 2000)
>
> Here I have a different scenario in Merge Replication using SQL SERVER
2000
> on Win2000 Server/Win 2000Adv Server/NtServer (all)
>
> DB1.Table1
> Identity Seed =1
> Identity Increment =2
> (auto number should be generated as odd numbers)
> Assume this data bydefault
> Column1 (AutoNo) Column2 (any char datatype)
> 1 A1
> 3 A3
>
> DB2.Table2
> Identity Seed =2
> Identity Increment =2
> (auto number should be generated as even numbers)
> Assume this data bydefault
> Column1 (AutoNo) Column2 (any char datatype)
> 2 B1
> 4 B3
>
> After Merge Replication, I received the following output both for Table1
and
> Table2 which is fine
> DB1.Table1 (1,2)
> Column1 (AutoNo) Column2 (any char datatype)
> 1 A1
> 3 A3
> 2 B1
> 4 B3
>
> DB2.Table2 (2,2)
> Column1 (AutoNo) Column2 (any char datatype)
> 1 A1
> 3 A3
> 2 B1
> 4 B3
> Here is a question :
> Now, I add some data at DB2.Table2. Note down next identity value in
Column1
> DB2.Table2 (2,2)
> Column1 (AutoNo) Column2 (any char datatype)
> 1 A1
> 3 A3
> 2 B1
> 4 B3
> 5 B4
>
> Here, according to identity seed=2 and identity increment=2
> Why I am receiving another id=5. However I was expecting it to be 6 b/c I
> have identified seed=2 and increment=2(even number not an odd number).....
>
> Thanks and Regards
> Asad Imam
> Pakistan.
>
>