SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 import/export but not entire database
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

scazikiss
Starting Member

USA
12 Posts

Posted - 11/29/2012 :  03:46:17  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 11/29/2012 :  06:46:38  Show Profile  Reply with Quote
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.
Go to Top of Page

scazikiss
Starting Member

USA
12 Posts

Posted - 11/29/2012 :  08:08:56  Show Profile  Reply with Quote
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
Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 11/29/2012 :  08:55:43  Show Profile  Reply with Quote
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?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000