-2

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

nvoigt
  • 75,013
  • 26
  • 93
  • 142
John John
  • 1
  • 72
  • 238
  • 501

1 Answers1

2

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

Akrem
  • 5,033
  • 8
  • 37
  • 64
  • can you explain your second point , so is there a way to have my database script including data for certian tables only? – John John Feb 18 '14 at 10:11
  • in this link it will copy the data for all the tables , while in my case i need to copy the data for the lookup table only .. – John John Feb 18 '14 at 10:53
  • @johnG and in the window of Choose Object you can select Select specific database objects and select only the tables you want – Akrem Feb 18 '14 at 10:55
  • @johnG with Choose Object you have to view all tables and select only the tables you want to generate – Akrem Feb 18 '14 at 10:56
  • in my case i need to generate the Schame-only for all the tables , and the data for the look-up tables only .. – John John Feb 18 '14 at 11:07
  • 1
    then you have to generate 2 script, the first with all tables (Schema Only) and the second script for only look-up tables (with DataOnly) – Akrem Feb 18 '14 at 11:12
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/47740/discussion-between-akrem-and-john-g) – Akrem Feb 18 '14 at 11:13