Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6359603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:32:25+00:00 2026-05-24T23:32:25+00:00

I have a very large table (800GB) which has a DATETIME field which is

  • 0

I have a very large table (800GB) which has a DATETIME field which is part of a partition schema. This field is named tran_date. The problem I’m having is that the indexes are not properly aligned with the partition and I can’t include the tran_date field in the PRIMARY KEY because it’s set to nullable.

I can drop all foreign key relationships, statistics, and indexes, but I can’t modify the column because the partition schema is still dependent on the tran_date column.

In my research I’ve located one way to move the table off of the partition which is to drop the clustered index and then re-write the clustered index onto the PRIMARY filegroup which will then allow me to modify the column, but this operation takes several hours to drop, 13 hours to write the temporary CLUSTERED INDEX on PRIMARY and then I have to drop that, alter the table, and re-write the CLUSTERED INDEX properly which takes another 13 hours. Additionally I have more than one table.

When I tested this deployment in my development environment with a similarly sized data set it took several days to complete, so I’m trying to look for ways to chop down this time.

If I can move the table off the partition without having to write a CLUSTERED INDEX on PRIMARY it would significantly reduce the time required to alter the column.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:32:27+00:00Added an answer on May 24, 2026 at 11:32 pm

    No matter what, you are going to end up moving data from “point A” (stored in table partitions within the database) to “point B” (not stored within table partitions within the database. The goal is to minimize the number of times you have to work through all that data. Simplest way to do this might be:

    • Create a new non-partitioned table
    • Copy the data over to that table
    • Drop the original table
    • Rename the new table to the proper name

    One problem to deal with is the clustered index. You could either create the new table without the clustered index, copy the data over, and then reindex (extra time and pain), or you could create the table with the clustered index, and copy the data over “in order” (say, low Ids to high). This would be slower than copying it over to a non-clustered table, but it might be faster overall since you wouldn’t then have to build the clustered index.

    Of course there’s the problem of “what if users change the data while you’re copying it”… but table partitioning implies warehousing, so I’m guessing you don’t have to worry about that.

    A last point, when copying gobs of data, it is best to break the insert into several inserts, so as to not bloat the transaction log.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very large table in MySQL. I'm using a CHAR(32) field which
I have a very large table with a fulltext indexed column. If I partition
I have a very large (millions of rows) SQL table which represents name-value pairs
I have a very large (~6GB) SVN repository, for which I've written a batch
I have a very large file that looks like this (see below). I have
I have a very large codebase (read: thousands of modules) that has code shared
I have a very large app, 1.5 million lines of C++, which is currently
I have a very large table (that overflows the content div) and because it's
I have a very large table in my database and I am starting to
I also have a very large table in SQL Server (2008 R2 Developer Edition)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.