SET IDENTITY INSERT

  • I wish to do the following:

    SET @SQL = "SET IDENTITY_INSERT " + @DB_NAME_TO + ".dbo.TBL_RELATIONSHIPS ON"

    EXEC(@SQL)

    As it may vary which database I write to depending on input paramter, BUT it does not work, I guess its to do with the scope of EXEC dynamic SQL, any work arounds?

  • include it with the rest of the dynamic SQL

Viewing 2 posts - 1 through 1 (of 1 total)

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