Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Prim Key Help

Author  Topic 

BackwoodsProgrammer
Starting Member

3 Posts

Posted - 2010-06-23 : 12:27:31
Hey all I need some help in understanding Identity Seed. I have a table with a column called primkey which has the identity seed set to yes. This table has some data from 3 sources.... manual, flatfile and hardcopy....every night the lines that have a source of flatfile and hardcopy are deleted and get copied from another database. When the two data sources are deleted the "manual" data takes up seed 22000-44000 when sql is loading the flatfile and hardcopy lines what happens when it hits seed 22000 does it look for the next seed avaliable or does it overwrite that line?

BackwoodsProgrammer
Starting Member

3 Posts

Posted - 2010-06-23 : 12:33:33
or does it start to load the data using line 44001??
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-06-23 : 12:35:38
next available...look at book online for more info...but you could write a simple test to check it out

BTW what does that give you? A unique row?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

BackwoodsProgrammer
Starting Member

3 Posts

Posted - 2010-06-23 : 12:38:18
what is the max seed for sql?
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-06-23 : 12:43:45
what version are you on?

Do you know what books online is?

Don't you have a real (natural) key?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-06-23 : 12:51:11
BOL

quote:


bigint
Integer (whole number) data from –2^63 (–9,223,372,036,854,775,808) through 2^63–1 (9,223,372,036,854,775,807). Storage size is 8 bytes.

integer
Integer (whole number) data from –2^31 (–2,147,483,648) through 2^31–1 (2,147,483,647).

Storage size is 4 bytes.

smallint
Integer data from –32,768 to 32,767. Storage size is 2 bytes.

tinyint
Integer data from 0 to 255. Storage size is 1 byte.






EDIT: You can start your seed as a negative number.

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -