troubleshooting Question

Applying Indexes to a table

Avatar of apresto
aprestoFlag for Italy asked on
Microsoft SQL Server
5 Comments1 Solution392 ViewsLast Modified:
Hi All.

I have written an application that will read a number of CSV files and insert the data from them into a table (roughly 60column).  And in total there will eventually be 46million records.

Now, i want to apply a clustered index to an int field but i dont know whether to apply it to the empty shell PRE-insert, or to apply it in bulk when the insertions have finished.

I know that it will take a long time either way, if i do it during insertion it will take longer to finish the insert processes, if i do it at the end it will take about 10 hours to index, i just want to make sure the integrity of the table remains 100% - im worried that if the indexes are written during insertion that something might go wrong - paranoia

Any suggestions?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros