Link to home
Start Free TrialLog in
Avatar of ziorrinfotech
ziorrinfotech

asked on

sql server auto increment

I have an asp.net website.
Now user can insert his data from this site to my sql server database.
Each table in the database has Auto increment set to true.

The process of uploading user data into my sql database is user first has to delete his old data from my database and then insert new data.
Now becasue of auto increment set to true my sql server always take last Number and increment it by 1 and insert a new record.
but in there chances that older IDs are empty but becasue of auto increment it always get new id.

I am getting this felling that soon it will fail becasue all the primary key are of int type and auto increment may reach to max of int.

is there any solution that i can overcome this problem
Avatar of Om Prakash
Om Prakash
Flag of India image

If you use autonumber, new id is assigned everytime a new record is inserted.

If you think data will be more if you use INT then you can use BIGINT datatype which can store value upto
9,223,372,036,854,775,807


ASKER CERTIFIED SOLUTION
Avatar of milindsm
milindsm
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ziorrinfotech
ziorrinfotech

ASKER

Thanks a ton