Adding column to take taking to long? You’re probably assigning a default.

When you create a column on a database, and you put that column on the right of the table the column shouldn’t be added almost instantly.  However if you are assigning a default value to the column and setting the column to now allow NULL values the operation will take quite a lot longer.  This is because when the operation happens the SQL Server has to write the values to each table.

If you allow the column to have NULL values then the database doesn’t have to write the values to the column so the operation completes very quickly.

Denny

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Trust DCAC with your data

Your data systems may be treading water today, but are they prepared for the next phase of your business growth?

Denny Cherry & Associates Consulting
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.