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
 changing datatype

Author  Topic 

shaggy
Posting Yak Master

248 Posts

Posted - 2009-07-09 : 03:07:10
Friends,

If i change datatype in a column (int to bigint) which is a clustered index column (production envr)
is there any right approach\any impact.
any guideliness to followw

Please suggest.

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2009-07-09 : 04:45:33
Is this column a key? (Guessing it might be as it's the CI).

If so, then any foreign key references will obviously have to change as well.


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

shaggy
Posting Yak Master

248 Posts

Posted - 2009-07-09 : 04:58:40
foreign key references i considered
i need to know any performance impact
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-07-09 : 05:15:11
I guess we won’t have much impact

-------------------------
R..
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2009-07-09 : 11:52:10
Depending on how much data you are talking about, this could be a really slow operation. I I remember correctly, SQL we attampt to reserve the space required for a BIGINT, so you will get page shuffling and such. We did something similar to a table (TINYINT to INT) with many billions of rows and it was faster to create a new table, dump all the data over to the new table then a drop a rename.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2009-07-09 : 12:58:26
Is it an IDENTITY column?

Clustering on an int though?

Don't you have a natural key?

how do you do look up's against this table?

not by int I would imagine



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 -