Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
scazikiss
Starting Member
12 Posts |
Posted - 2012-11-29 : 03:46:17
|
hello experts, in the same instance, i have a database1 and would like to export a part of the database1 and import in the database2 . i used the sql management studio tool to do this. but when the database2 created, the tables were in but not the indexes, constraints..etc.. do you know why ..? i may be miss something in the procedure. thks for your help.regard |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-11-29 : 06:46:38
|
What method did you use to do the import from SSMS? Did you use the Tasks -> Generate Scripts, method? If so, in the "Choose Script Options" dialog of the wizard Generate Scripts wizard, you have options for scripting indexes, constraints, triggers and just about everything else. |
|
|
scazikiss
Starting Member
12 Posts |
Posted - 2012-11-29 : 08:08:56
|
thank you for your reply.you mean that we must generate scripts for creating indexex first then after creating the new database we execute the creating indexes scripts... you don't have the method to do all of this together...? Thanks.regard |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-11-29 : 08:55:43
|
That is not what I meant.An index cannot exist in the absence of the table on which the index is built. So what Microsoft has done is to allow you the option of scripting (or not scripting) dependent objects (such as indexes) when you script objects such as tables.It would be much more clearer if you experiment with the Generate Scripts wizard than when I explain it.What method did you use to script the database objects? |
|
|
|
|
|