Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
Administering
»
Identity column maxed out
20 posts, Page 2 of 2
««
1
2
Identity column maxed out
Rate Topic
Display Mode
Topic Options
Author
Message
Lowell
Lowell
Posted Monday, December 21, 2009 1:01 PM
SSChampion
Group: General Forum Members
Last Login: Today @ 9:36 AM
Points: 11,618,
Visits: 27,680
Joe-420121 (12/21/2009)
The following procedure is OK?
1. Create Table [backup12212009] with BIGINT Indentity
2. using SSIS export data from old table to [backup12212009]
3. Delete old table
4. Rename backup12212009
Can do as above?
if there are any dependent foreign keys on the table, or if the table has any constraints or defaults then no, that is
NOT
the way to do it.
doing a full backup and additionally backing up the table as Jason suggested, and then using the SSMS GUI is the way to do it.
Lowell
--
There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #837500
SQLRNNR
SQLRNNR
Posted Monday, December 21, 2009 1:03 PM
SSCoach
Group: General Forum Members
Last Login: Yesterday @ 1:07 PM
Points: 18,733,
Visits: 12,332
Lynn Pettis (12/21/2009)
Joe-420121 (12/21/2009)
The following procedure is OK?
1. Create Table [backup12212009] with BIGINT Indentity
2. using SSIS export data from old table to [backup12212009]
3. Delete old table
4. Rename backup12212009
Can do as above?
Why not just use INSERT INTO? Just be sure to enable INDENTITY insert either way, and if using T-SQL, to turn it off when done.
As Lynn said, I would use the INSERT INTO. It will be faster in most cases.
Also, it is very important that when you create the table that it is created to mirror the original table with the exception of the BIGINT.
I, would also not Drop the old table for several weeks. I like to keep it around as a failsafe. It is much faster to recover from that table than from backup.
Jason
AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server 2008
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #837501
Carlos Pereyra
Carlos Pereyra
Posted Monday, December 21, 2009 1:05 PM
SSC Journeyman
Group: General Forum Members
Last Login: Friday, March 12, 2010 3:04 PM
Points: 75,
Visits: 35
If you're going to use INSERT INTO, you'll need to name all the columns. One easy way to get the list of columns (if the table has many) is "select name + ',' from syscolumns where object_name(id) = 'mytablename' order by colorder (Replace mytablename with the name of your table) This will give you the columns and the commas in-between.
Carlos.
Regards,
Carlos
Post #837505
Carlos Pereyra
Carlos Pereyra
Posted Monday, December 21, 2009 1:09 PM
SSC Journeyman
Group: General Forum Members
Last Login: Friday, March 12, 2010 3:04 PM
Points: 75,
Visits: 35
Any reason why you're not using alter table alter column?
as in alter table mytable alter column my column bigint?
Carlos.
Regards,
Carlos
Post #837512
SQLRNNR
SQLRNNR
Posted Monday, December 21, 2009 1:15 PM
SSCoach
Group: General Forum Members
Last Login: Yesterday @ 1:07 PM
Points: 18,733,
Visits: 12,332
Carlos Pereyra (12/21/2009)
Any reason why you're not using alter table alter column?
as in alter table mytable alter column my column bigint?
Carlos.
The best answer is - as a safeguard - but the OP will have to respond.
Jason
AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server 2008
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #837520
Joe-420121
Joe-420121
Posted Monday, December 21, 2009 1:22 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Today @ 9:22 AM
Points: 107,
Visits: 330
1. The table has only 4 coulmmns, no FK, constrains etc.
2. The table is used 24 hours, and about 2000 users use it all the time.
3. When I use GUI to modify data type to BIGINT, I get timeout error after 3 min.
4. Copy data to tmp table and when all done, and drop the old table and just rename it quicky.
( also I am creating the table in a new file group).
5. The size of table is about 60GB, so I feel SELECT INTO might take more time than SSIS. am I wrong?
Thanks for all your helps...
Post #837529
Lynn Pettis
Lynn Pettis
Posted Monday, December 21, 2009 1:25 PM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 9:22 AM
Points: 21,599,
Visits: 27,419
Joe-420121 (12/21/2009)
1. The table has only 4 coulmmns, no FK, constrains etc.
2. The table is used 24 hours, and about 2000 users use it all the time.
3. When I use GUI to modify data type to BIGINT, I get timeout error after 3 min.
4. Copy data to tmp table and when all done, and drop the old table and just rename it quicky.
( also I am creating the table in a new file group).
5. The size of table is about 60GB, so I feel SELECT INTO might take more time than SSIS. am I wrong?
Thanks for all your helps...
SSIS probably would not be any faster.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #837532
homebrew01
homebrew01
Posted Monday, December 21, 2009 1:43 PM
SSCrazy
Group: General Forum Members
Last Login: Yesterday @ 11:39 AM
Points: 2,551,
Visits: 7,205
Joe-420121 (12/21/2009)
3. When I use GUI to modify data type to BIGINT, I get timeout error after 3 min
.
Instead of using the GUI locally on your desktop, use the GUI to generate the script, then log on to the server remotely and run the the script there in a query window.
Post #837545
SQLRNNR
SQLRNNR
Posted Monday, December 21, 2009 3:45 PM
SSCoach
Group: General Forum Members
Last Login: Yesterday @ 1:07 PM
Points: 18,733,
Visits: 12,332
IMHO, SSIS will be slower for this kind of process.
As homebrew said, you could use the GUI to script the changes. And then run them from the server itself.
Also, you could use the alter column to change the column to a bigint.
Jason
AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server 2008
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #837618
Jeff Moden
Jeff Moden
Posted Monday, December 21, 2009 7:41 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 6:23 AM
Points: 32,903,
Visits: 26,784
homebrew01 (12/21/2009)
CirquedeSQLeil (12/21/2009)
Then a simple select * into tablebackup12212009 from table would suffice for the backup.
I seem to recall that you can get blocking when creating a table this way if the source table is big because system locks are held until the insert is complete. You could create the empty table tablebackup12212009 first , then insert the data.
It's an absolute myth that was once true prior to SQL Server 6.5 sp1.
http://support.microsoft.com/kb/153441/EN-US/
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #837697
« Prev Topic
|
Next Topic »
20 posts, Page 2 of 2
««
1
2
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.