Clear destination database before sync
brian.chiu.rt
Posts: 4
does anyone know if there's a way to clear the destination database before each sync?
I know this process might be a bit weird but what we're trying to do here is to create a schema backup for multiple databases by using redgate to sync with a staging DB before creating a backup of it.
thanks,
brian
I know this process might be a bit weird but what we're trying to do here is to create a schema backup for multiple databases by using redgate to sync with a staging DB before creating a backup of it.
thanks,
brian
Comments
There's no option in SQL Compare to do this; but a workaround would be to have an empty database on your server, and first sync from this to the target (which should drop everything) then run your usual sync afterwards. But as I said above, the end result would be the same as the sync you're already doing.
Redgate Software
sqlcmd -SYourServer -Q "ALTER DATABASE YourDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE; DROP DATABASE YourDB"
sqlcmd -SYourServer -Q "CREATE DATABASE YourDB"
Can I ask why you're creating these schema backups? How will they be used?
David Atkinson
Product Manager
Red Gate
Product Manager
Redgate Software