I'm creating a temporary table and would like to create a primary and secondary XML index on a contained xml column within the CREATE TABLE statement since that is the only way I can create an index without throwing an error under snapshot isolation.

I know the syntax for creating standard (non-XML) clustered and nonclustered indexes inline, and it works fine, but I don't seem to be able to find a syntax that works for XML indexes either in documentation or via experimentation.

Does anyone know whether this is possible?

1 Answer 1


I just tried using the XML index creation commands in-lined with a table creation, and it didn't work.

I stumbled upon this article that makes it look like trying to create non-relational indexes (XML, columnstore, or spatial) doesn't work with in-lining the index creation statement in the table definition.

  • 1
    Disappointing, but I'll just need to find another way. Thanks!
    – mwigdahl
    Jun 16, 2020 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.