Are you using automatic range management? If so, the
process of synchronization will reseed if you achieve a
set % of available values. I'd advise against relying on
this behaving correctly in all circumstances and force
the system to never reseed by allocating a huge range to
each subscriber. An integer datatype can span -2billion
to 2billion or so, so there is not really any need to
ever have such a small range that reseeding occurs (IMHO).
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
Thanks but these is not the problem. Perhaps I didn't express correctly.
I know the merge replication automatically reseed when it reaches the
imposed limit, but what happened to me is that this seed has returned to
an anterior value, so with the IDs I get concurrence troubles
replicating. The replication and range automatic asignation works
correctly, but I don't know what I did to make the seed backward to a
previous value. The seed didn't reached its limit.
I changed manually the values of the seed in
Distribution.MSrepl_identity_range, but I want to know in what
circurstances those values are being reinitialized to a previous value.
Thanks
Juan
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
|||are they reseeded on the publisher, subscriber or both?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Juan a" <juan@.mailinator.com> wrote in message
news:uNotHeU$EHA.4004@.tk2msftngp13.phx.gbl...
>
> Thanks but these is not the problem. Perhaps I didn't express correctly.
> I know the merge replication automatically reseed when it reaches the
> imposed limit, but what happened to me is that this seed has returned to
> an anterior value, so with the IDs I get concurrence troubles
> replicating. The replication and range automatic asignation works
> correctly, but I don't know what I did to make the seed backward to a
> previous value. The seed didn't reached its limit.
> I changed manually the values of the seed in
> Distribution.MSrepl_identity_range, but I want to know in what
> circurstances those values are being reinitialized to a previous value.
> Thanks
> Juan
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!
|||They are reinitialized on publisher, but because of automatic range
administration, when the SQLCe synchronize it gets the range asigned
from the publisher, an old range that was used before, and that already
have registers in publisher.
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
Showing posts with label reseed. Show all posts
Showing posts with label reseed. Show all posts
Monday, March 19, 2012
Wednesday, March 7, 2012
IDENTITY column reseed
Hi,
I am using a SQL server table in my Java application. I want to prevent
reseeding of the identity column.
Table T1:
C1 INT IDENTITY NOT FOR REPLICATION PRIMARY KEY,
C2 VARCHAR(100)
Say I have values:
1, 'abc'
2, 'xyz'
I can explicitly insert a value for C1 into this table by :
SET IDENTITY_INSERT T1 ON
INSERT INTO T1 VALUES(101, 'foo');
Now, if I do,
INSERT INTO T1 VALUES('blah');
I see the following data in the table:
1, 'abc'
2, 'xyz'
101, 'foo'
102, 'blah'
I have specified identity column C1 as NOT FOR REPLICATION and inserted
'foo' with explicit C1 value of 101.
Why does the identity column reseed after this?
How do I achieve a key value of 3 for the row with 'blah'?
Basically I expec to see:
1, 'abc'
2, 'xyz'
101, 'foo'
3, 'blah'
Any suggestions appreciated.
Thanks,
Esak.
I am curious as to why you want to do this. If you reseed you will run into
problems when your identity value starts to hit 100.
To reseed issue a DBCC CheckIdent('T1',reseed,3)
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Esak" <esankaran@.datamirror.com> wrote in message
news:exYX6fC3FHA.3136@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I am using a SQL server table in my Java application. I want to prevent
> reseeding of the identity column.
> Table T1:
> C1 INT IDENTITY NOT FOR REPLICATION PRIMARY KEY,
> C2 VARCHAR(100)
> Say I have values:
> 1, 'abc'
> 2, 'xyz'
> I can explicitly insert a value for C1 into this table by :
> SET IDENTITY_INSERT T1 ON
> INSERT INTO T1 VALUES(101, 'foo');
> Now, if I do,
> INSERT INTO T1 VALUES('blah');
> I see the following data in the table:
> 1, 'abc'
> 2, 'xyz'
> 101, 'foo'
> 102, 'blah'
> I have specified identity column C1 as NOT FOR REPLICATION and inserted
> 'foo' with explicit C1 value of 101.
> Why does the identity column reseed after this?
> How do I achieve a key value of 3 for the row with 'blah'?
> Basically I expec to see:
> 1, 'abc'
> 2, 'xyz'
> 101, 'foo'
> 3, 'blah'
>
> Any suggestions appreciated.
> Thanks,
> Esak.
>
>
|||Hi Hilary,
I am looking for a way to turn off reseeding the IDENTITY column value.
The SQL server replication agent looks for the NOT FOR REPLICATION option on
IDENTITY columns and does not reseed the value. How can I achieve the same
in my SQL/Java application?
Do you think the NOT FOR REPLICATION option for IDENTITY column is
applicable only for the replication agent?
Thanks,
Esak.
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:Ormz5dK3FHA.3188@.TK2MSFTNGP12.phx.gbl...
> I am curious as to why you want to do this. If you reseed you will run
into
> problems when your identity value starts to hit 100.
> To reseed issue a DBCC CheckIdent('T1',reseed,3)
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Esak" <esankaran@.datamirror.com> wrote in message
> news:exYX6fC3FHA.3136@.TK2MSFTNGP09.phx.gbl...
>
I am using a SQL server table in my Java application. I want to prevent
reseeding of the identity column.
Table T1:
C1 INT IDENTITY NOT FOR REPLICATION PRIMARY KEY,
C2 VARCHAR(100)
Say I have values:
1, 'abc'
2, 'xyz'
I can explicitly insert a value for C1 into this table by :
SET IDENTITY_INSERT T1 ON
INSERT INTO T1 VALUES(101, 'foo');
Now, if I do,
INSERT INTO T1 VALUES('blah');
I see the following data in the table:
1, 'abc'
2, 'xyz'
101, 'foo'
102, 'blah'
I have specified identity column C1 as NOT FOR REPLICATION and inserted
'foo' with explicit C1 value of 101.
Why does the identity column reseed after this?
How do I achieve a key value of 3 for the row with 'blah'?
Basically I expec to see:
1, 'abc'
2, 'xyz'
101, 'foo'
3, 'blah'
Any suggestions appreciated.
Thanks,
Esak.
I am curious as to why you want to do this. If you reseed you will run into
problems when your identity value starts to hit 100.
To reseed issue a DBCC CheckIdent('T1',reseed,3)
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Esak" <esankaran@.datamirror.com> wrote in message
news:exYX6fC3FHA.3136@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I am using a SQL server table in my Java application. I want to prevent
> reseeding of the identity column.
> Table T1:
> C1 INT IDENTITY NOT FOR REPLICATION PRIMARY KEY,
> C2 VARCHAR(100)
> Say I have values:
> 1, 'abc'
> 2, 'xyz'
> I can explicitly insert a value for C1 into this table by :
> SET IDENTITY_INSERT T1 ON
> INSERT INTO T1 VALUES(101, 'foo');
> Now, if I do,
> INSERT INTO T1 VALUES('blah');
> I see the following data in the table:
> 1, 'abc'
> 2, 'xyz'
> 101, 'foo'
> 102, 'blah'
> I have specified identity column C1 as NOT FOR REPLICATION and inserted
> 'foo' with explicit C1 value of 101.
> Why does the identity column reseed after this?
> How do I achieve a key value of 3 for the row with 'blah'?
> Basically I expec to see:
> 1, 'abc'
> 2, 'xyz'
> 101, 'foo'
> 3, 'blah'
>
> Any suggestions appreciated.
> Thanks,
> Esak.
>
>
|||Hi Hilary,
I am looking for a way to turn off reseeding the IDENTITY column value.
The SQL server replication agent looks for the NOT FOR REPLICATION option on
IDENTITY columns and does not reseed the value. How can I achieve the same
in my SQL/Java application?
Do you think the NOT FOR REPLICATION option for IDENTITY column is
applicable only for the replication agent?
Thanks,
Esak.
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:Ormz5dK3FHA.3188@.TK2MSFTNGP12.phx.gbl...
> I am curious as to why you want to do this. If you reseed you will run
into
> problems when your identity value starts to hit 100.
> To reseed issue a DBCC CheckIdent('T1',reseed,3)
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Esak" <esankaran@.datamirror.com> wrote in message
> news:exYX6fC3FHA.3136@.TK2MSFTNGP09.phx.gbl...
>
Subscribe to:
Posts (Atom)