Question

I have generate a "schema only " database script for my staging database, using sql server 2008 r2 . now i need to execute the script to create the same database including (table, column, keys, etc) inside the production server. so my question i how i can execute the script inside the production server.

Second question; currently i have generate the script to include only the schema, but i have some look-up tables which i need to move its data from staging to production. so my question is how i can generate a script that copy the schema or the whole database , and also copy the data for specific tables ?

Thanks

Was it helpful?

Solution

for your first question :

you have to create your data base manualy if your scrip have only tables shema and open new query window and run it

for your second question :

from sql server managment studio you have to do Generate script in Tasks then choose your tables then in Advanced there's Type of data script you have to shoose Schema only or data or Scema with data

More explanation

I found this link to explaine generate script, and in the window of Choose Object you can select Select specific database objects and select only the tables you want

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top