Generate USE [database] on top of the script
Just adding USE [database] on top of the script will help people to guarantee the changes are not deployed to the wrong database, especially when you just copy/paste into SSMS

This feature is now supported by using the “Add database USE statement” option on the project options tab.
Documentation on all available options in SQL Compare can be found here: https://documentation.red-gate.com/display/SC11/Setting+project+options#Settingprojectoptions-AdddatabaseUSEstatement
-
Dan W commented
Thank you for adding this option. I really like it! However, it could easily do more to "guarantee the changes are not deployed to the wrong database". if the target database does not exist on the current server, the USE [database] statement fails, but the script will try to do the actions until the first error occurs (assuming you have error handling enabled).
I posted a suggested implementation option under https://redgate.uservoice.com/forums/141379-sql-compare/suggestions/4276922-add-option-to-stop-processing-if-the-database-in-t :
In keeping with the rest of the error handling, simply put the IF @@ERROR <> 0 SET NOEXEC ON after the USE [my_database] statement in the synchronization script, such as:
USE [my_database]
GO
IF @@ERROR <> 0 SET NOEXEC ON
GOThis doesn't protect against scripts from being run against the right database on the wrong server, but it at least it prevents scripts from being applied if the change to the expected target database fails.
-
David Eadie commented
Hi, This feature is already supported by using the "Add database USE statement" option on the project options tab.
Documentation on all available options in SQL Compare can be found here: https://documentation.red-gate.com/display/SC11/Setting+project+options#Settingprojectoptions-AdddatabaseUSEstatement