Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

__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...

like image 766
noonand Avatar asked Jun 25 '16 11:06

noonand


People also ask

Will Dacpac delete tables?

Dacpac deploys will NOT by default drop objects it finds in the target database that do not exist in the source. This means just deleting a table in SSDT will not try to drop it on a deploy.

What is database Refactorlog?

refactorlog file is created. This file is used to modify the standard behavior when generating the database deployment script. Instead of dropping a column and creating a new one, the script will rename the existing column in the database if it has been declared as rename in the . refactorlog file.

What is SSDT?

SQL Server Data Tools (SSDT) is a modern development tool for building SQL Server relational databases, databases in Azure SQL, Analysis Services (AS) data models, Integration Services (IS) packages, and Reporting Services (RS) reports.


1 Answers

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

like image 132
Ed Elliott Avatar answered Oct 21 '22 17:10

Ed Elliott