Adding column takes forever

  • I'm trying to add a column to a table and it is taking forever. The table is very straightforward with only three existing columns and only 22k rows of data. There are some indexes/statistics.

    the command I tried to run is:

    ALTER TABLE tblRXList

    ADD Generic bit NULL

    DEFAULT 0 WITH VALUES

    the process ran for an hour before I canceled it.

    Thoughts?

    Thanks,

    Jay

  • My guess would be that something is using the table and has a schema lock on it as a consequence (note that opening the table, or opening the designer on the table in SSMS will do this). Use sp_Who2, or sp_lock or the Activity Monitor after you start your command to see what is blocking it.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • BINGO!

    Found the process that was blocking it and KILLed it! Looks like it was some old mail merge connection or something.

    Thanks so much!

    Jay

  • Glad I could help!

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply