When doing that generate scripts on the database level what difference does it do from doing a backup and restore on the database? It seems to me that they both provide the same purpose. What would be best to use between the two? Is one better than the other?
I am migrating database from one domain to another and both are different domain but have sql server 2012
Sql-server – Difference between Generate Script option at database level and backup and restore option
sql serversql-server-2012
Related Question
- Sql-server – Backup and Restore of Development
- Sql-server – Generate Database Creation Script Within A Stored Procedure
- Sql-server – How to script permissions for all logins/users/tables/schemas
- Sql-server – How to implement a quick backup and restore strategy for database script testing
- Sql-server – Generate backwards compatible CREATE DATABASE script with all objects
- Sql-server – Restore script while setting up database mirroring on secondary server
- Sql-server – Difference between changed compatibility level database and new database
- Sql-server – SQLServer: Backup a database on a server and restore it on another server
Best Answer
With backup you have all data. Of course you can generate script for data, but for a DB with 1-2 GB the script will be very big and will execute long time.
The best way in my point of view is
detach/attach
method. It will preserve the current state of the DB. Of course you can make backup before that. In that case you also have to take into account downtime for transferring database between servers.