Noman Ahmad
Noman Ahmad

Reputation: 360

exporting schema and data from one DB to other in SQL Server 2012

i want to export data and schema from live Database to my local database, i tried "export data" option while right clicking on live db but it only exports data but not constraints on columns. kindly help me out?

Upvotes: 0

Views: 246

Answers (1)

Rodrigo Kiguti
Rodrigo Kiguti

Reputation: 542

Try this:

  1. Open SQL Server Management Studio.
  2. Choose the database and click with right button.
  3. Tasks > Generate Scripts...
  4. Next.
  5. Select the objects (tables, etc) or select the entire database and click next.
  6. Click Advanced button and select what do you want. There is an option "Types of data to script", select "Schema and data".
  7. Next

If the database is big you will need to execute the script using the prompt in your local database.

Upvotes: 2

Related Questions