Uri Dimant
3/28/2007 5:53:00 AM
> IDENTITY >causing< gaps, but that is no big thing.
You meant >causing< duplicates ? :-))
"Roy Harvey" <roy_harvey@snet.net> wrote in message
news:1cbi03hevcvaeu0mg6fi8e4scd6cpp9h6n@4ax.com...
> Thanks, I understand what you meant now. I would not describe that as
> IDENTITY >causing< gaps, but that is no big thing.
>
> Roy Harvey
> Beacon Falls, CT
>
> On Tue, 27 Mar 2007 14:39:13 +0200, "Uri Dimant" <urid@iscar.co.il>
> wrote:
>
>>Roy
>>There are two methods that I know about them
>>
>>Palmem had demonstrated one of them
>>
>>create table test (col1 int identity(1,1),col2 char(1))
>>create table test_demo (c int)
>>
>>insert into test_demo values (1)
>>insert into test_demo values (2)
>>
>>
>>insert into test (col2) values ('a')
>>insert into test (col2) values ('b')
>>
>>
>>set IDENTITY_INSERT test ON
>>insert into test (col1) select c from test_demo
>>set IDENTITY_INSERT test OFF
>>
>>select * from test --we have duplicates
>>
>>--another one is to use
>>--DBCC CHECKIDENT
>>
>>DBCC CHECKIDENT (test, RESEED, 1)
>>insert into test (col2) values ('a')
>>select * from test
>>
>>
>>"Roy Harvey" <roy_harvey@snet.net> wrote in message
>>news:hg1i03t3k3trd8i7q9246ljssjrv8jtbts@4ax.com...
>>> On Tue, 27 Mar 2007 08:17:00 +0200, "Uri Dimant" <urid@iscar.co.il>
>>> wrote:
>>>
>>>>Actually an INDENTITY property can cause gaps as well as duplicates.
>>>
>>> I know about the gaps, but don't recall ever hearing about the
>>> duplicates. Can you expand on that?
>>>
>>> Roy Harvey
>>> Beacon Falls, CT
>>