Search code examples
sql-serversql-server-data-tools

__RefactorLog table in SQL Server - safe to drop it?


SSDT (I suspect) creates a table called __RefactorLog in any database you point it towards.

If I've hit a release is there any harm in deleting this table as I don't see any benefit in including it in schema creation scripts at the time of deployment?

I can't see any downside to it myself, but I'd like to pose the question to the knowledgeable people here to see if there's something I'm missing...


Solution

  • It is created by SSDT when you use a refactor in SSDT (like Refactor -> Rename) if you do a deployment and just clear out the table it will retry to do any old refactorings which could just fail or cause a disaster!

    If you clear the table make sure you also remove the entries from the refactorlog.xml in your project - the file is pretty obvious.

    Make sure you don't try to deploy an old dacpac (I guess this is unlikely anyway)

    Ed