twitterfacebookgoogle plusrss feed

Pages

Thursday, February 24, 2011

Export MS SQL script


In Enterprise Manager in the Console Root you can click on Tools then select Data Transformation Services and then select whether you are going to import or export data.
Another way to do this in Enterprise Manager there is a row of icons at the top of the Console Root. Look for the Wizard's Wand and then select Data Transformation Services and then select whether you are going to import or export data.
Another way to do this is to select the database in the left pane of the Console Root (you can also do this by pointing to tables if you have expanded the database) then right mouse click, this will bring up a list with one of the options being All Tasks, from here you can click Import Data or Export Data. This will open the DTS wizard.
One more way to move data is in the left pane of the Console Root you will find a folder called Data Transformation Services, expand that folder and click on Local Packages. Then in the right pane right mouse click and select New Package, this doesn't use the wizard here so you have to select each item from the list of icons. I don't recommend this one if you are a beginner to SQL Server.
Now if you want to make a copy of the database only but not copy the data you can also make a Script of the database. This can include all users, roles, SQL Server logins, object level permissions, Triggers, Indexes, constraints like Primary & Foreign keys as well as SPROCs and UDFs. This is done in Enterprise Manager by selecting the database in the left pane of the Console Root, right mouse click on that database then select All Tasks and from here select Generate SQL Script, click that then in the window that just opened click the button labeled Show All, then check the box for Script all objects, Then click Options and select the options you want, then finally click OK and you will have a script generated which can then be used to build a copy of the database (sans data).

0 comments:

Post a Comment

comment or ask