Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • Have you used sp_tableoption? Commented Oct 21 at 8:18
  • 6
    I think you need to provide table definition and index you are trying to create. There are restrictions for creating indexes online, but I don't see how NVARCHAR(MAX) restricts you in any obvious way. Commented Oct 21 at 11:16
  • 1
    "This will mean a staged process which will end in dropping the NVARCHAR(MAX) columns from the original tables." - FWIW, it would probably be more efficient to leave those heavy columns in the original table, and move the other lighter columns to a new table, and then use sp_rename to just rename the tables accordingly, or even better, use a view with the original table name, that joins the two tables back together, as your layer of abstraction. Commented Oct 21 at 21:29
  • Thanks @J.D. that makes sense. It achieves the goal of being able to add indexes ONLINE going forward. The last outage was too long. Commented Oct 22 at 1:37
  • 1
    SQLFiddle says otherwise. So you need to provide more info like DDL for the table and index, SQL Server version, errors you are getting. Commented Oct 22 at 7:21