Paste this into a new question or an answer at dba.stackexchange.com:
<!-- --> > SET TRANSACTION ISOLATION LEVEL SNAPSHOT; > > CREATE TABLE dbo.T (n integer NULL); > GO > > <pre> > ✓ > </pre> <!-- --> > CREATE TRIGGER trg ON dbo.T > AFTER INSERT AS > BEGIN > SELECT * INTO #i FROM Inserted > CREATE INDEX i ON #i (n); > END; > GO > > <pre> > ✓ > </pre> <!-- --> > SET IMPLICIT_TRANSACTIONS ON; > > INSERT dbo.T (n) VALUES (1); > > SET IMPLICIT_TRANSACTIONS OFF; > GO > > <pre> > Msg 3964 Level 16 State 1 Line 5 Transaction failed because this DDL statement is not allowed inside a snapshot isolation transaction. Since metadata is not versioned, a metadata change can lead to inconsistency if mixed within snapshot isolation. > </pre> *db<>fiddle [here](https://dbfiddle.uk/?rdbms=sqlserver_2017l&fiddle=30a687fb577c50b20204c30997db6262)*
back to fiddle