Re: Append Data

From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 07/29/04


Date: Thu, 29 Jul 2004 13:00:14 +0530

Hi,

Use "SET IDENTITY_INSERT" to allow explicit values in acolumn with identity.

See SET IDENTITY_INSERT in books online. There is good example as well which
shows the usage.

Sample:-

create table id1(i int identity, k char(10))
create table id2(i int identity, k char(10))
go
insert into id1(K) values('hari')
insert into id2(K) values('raj')
go
select * from id1
select * from id2
go
set identity_insert id1 on
insert into id2(k) select k from id1
go
select * from id2

Thanks
Hari
MCDBA

"GW" <anonymous@discussions.microsoft.com> wrote in message
news:657801c4753d$a64178e0$a501280a@phx.gbl...
> Hi,
>
> Appreciated it if someone could help me with regards to
> the abovesaid problem.
>
> I don't know how to append data using SQL Query Analyzer
> from table a to table b because it will create duplicate
> table b.recordnumber(auto number) in table b. I tried to
> use DTS but failed due to the duplicate record number(auto
> number).
>
> tq.



Relevant Pages