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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 how to set auto increment on large table ?

Author  Topic 

zeeshanhanif
Starting Member

7 Posts

Posted - 2008-06-17 : 03:39:32
Asalam o alykum!!!

i just want to know tht i have table which have large record almost 7 lakh round about , when i set auto increment on it gives me timeout error, is der any easy way to ON auto increment ??

Thank you

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-17 : 03:41:54
By auto increment do you mean making a column identity?
Go to Top of Page

zeeshanhanif
Starting Member

7 Posts

Posted - 2008-06-17 : 03:50:44
right now i m manually giving numbers to my column, now i want my column to auto generate numbers..
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-17 : 03:58:51
quote:
Originally posted by zeeshanhanif

right now i m manually giving numbers to my column, now i want my column to auto generate numbers..


Modify your column to be of identity type.
Follow procedure below to change it to identity

http://www.tomkitta.com/blog/index.cfm?data=27/10/2005

http://www.mssqltips.com/tip.asp?tip=1397
Go to Top of Page

zeeshanhanif
Starting Member

7 Posts

Posted - 2008-06-17 : 04:38:13
brother i already have table ... it has 7 lakh record ... now i cant make new table n import my records der ......

thts y i m searching for solution so that i can make my table auto increment true ....

ne idea would b appreciated..

thanx
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-17 : 04:51:37
quote:
Originally posted by zeeshanhanif

brother i already have table ... it has 7 lakh record ... now i cant make new table n import my records der ......

thts y i m searching for solution so that i can make my table auto increment true ....

ne idea would b appreciated..

thanx


ok then go for first solution. It just asks you to create a new column with type identity. There's no easy way to modify a column to be of type identity.
Go to Top of Page

zeeshanhanif
Starting Member

7 Posts

Posted - 2008-06-17 : 04:58:38
Thanx alot brother.. this is something near wht i want to do ...

Go to Top of Page

zeeshanhanif
Starting Member

7 Posts

Posted - 2008-06-17 : 05:49:09
it doesnt solve my problem though :( , bcoz i have different scenerio ... ne wayzzz i appreciate ur quick responses ...

thanx

Go to Top of Page
   

- Advertisement -