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)
 Max value of BigInt

Author  Topic 

kwikwisi
Constraint Violating Yak Guru

283 Posts

Posted - 2009-12-16 : 01:41:48
If i'm not wrong, the max value of int is 2147483647 . But I want to have greater value than int. So I tried to change datatype to BigInt in existing table and it doesnt allow to change the data type.

Can anybody tell me how to change the datatype of col in existing table [with data] and max value of bigInt ?

thanks in advance.

kwikwisi
Constraint Violating Yak Guru

283 Posts

Posted - 2009-12-16 : 01:50:03
I used below and it throws error.

alter table tblTest
alter column ID bigint not null
go

Error:

Msg 5074, Level 16, State 1, Line 1
The object 'PK_tblTest' is dependent on column 'ID'.
Msg 4922, Level 16, State 9, Line 1
ALTER TABLE ALTER COLUMN ID failed because one or more objects access this column.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-12-16 : 03:37:17
Is it foreign key to any other table?
If so, you need to change them too

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -