May 20, 2011 at 12:50 am
Hi ,
Please help to know what is the limit of identity ....I ran this command and it worked but i dont know maximum limit
create table testj(
id int identity (1,500000000))
May 20, 2011 at 12:55 am
U can check the url
May 20, 2011 at 12:58 am
disha1 (5/20/2011)
Hi ,Please help to know what is the limit of identity ....I ran this command and it worked but i dont know maximum limit
create table testj(
id int identity (1,500000000))
I think u are misunderstanding the syntax... 500000 is not the limit rather the increment each row should take..
May 20, 2011 at 1:06 am
yes , right but here i got another problem..i m not able to insert data in this table
create table testj(
id int identity (1,500000000))
i tried these statments but got the error :
Msg 8101, Level 16, State 1, Line 2
An explicit value for the identity column in table 'testj' can only be specified when a column list is used and IDENTITY_INSERT is ON.
insert into testj values()
or
insert into testj values(1)
or
insert into testj values(2)
or
insert into testj values(499999999)
May 20, 2011 at 5:47 am
the max value of the column, whether it's inserted by the identity() or not, is the max value of the data type...int, bigint, whatever type you decide.
an int is 2 billion and change, you can look it up; it's one less than this:select POWER(2,31) (2147483647)
because you have no other columns in your insert statement, other than the Id column, you have to use the DEFAULT VALUES command:
create table testj(
id int identity (1,500000000))
insert into testj DEFAULT VALUES
Lowell
May 20, 2011 at 2:15 pm
thanks a lot Lowell..it was great help...when will i have this much of brain 🙂
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply