all groups > sql server replication > may 2006 >
You're in the

sql server replication

group:

Auto Number effect


Auto Number effect gurvar
5/31/2006 2:26:01 PM
sql server replication:
Hi

I have a old database A which need to be exported,
made changes like including some columns/delete columns etc
and imported again (basically changing MetaDB) as database B.

Question is what will happen to the Auto number generated fields?

Database A has Auto fields ID starting at 134,135,156 etc
After changing it to Database B and I enter a new records
will it be assigned an ID such as 1,2,3 etc?

Really appreciate any feed back.

Thanks.
Re: Auto Number effect Hilary Cotter
6/1/2006 6:06:14 AM
Yes it will, unless you use identity_insert on database b. If you use bcp to
push your data you can use the -E switch which will preserve the identity
values.

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

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



[quoted text, click to view]

Re: Auto Number effect Paul Ibison
6/1/2006 9:30:58 AM
Are you using replication to create Database B from Database A? If so, what
type of replication are you using?
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com

Re: Auto Number effect gurvar
6/1/2006 10:45:03 AM
Actually I'm using DTS to get it to an Excel spread sheet, make changes like
add/delete columns & change data & then import it back.

If there is any better way of doing the above please advice or I will be
glad to look at any books or pointers.

So finally the conclusion is I need not have to worry about the missing ID
in previous data base(A).They are bissing because they have been deleted as
they were dummy records used for testing. So the ID's will be once again
created in the new data base right and the existing ID's will not get
duplicated.

Thank you all.

[quoted text, click to view]
Re: Auto Number effect lara169
6/1/2006 4:44:33 PM
While creating the table you can mention the starting value
Create table SecondTable( i int identity(135,1), j int) ---

now if you have already created the table you can change the identity value
by

DBCC CHECKIDENT (urTableName, RESEED, 135)


[quoted text, click to view]


AddThis Social Bookmark Button