搜索
 找回密码
 加入

How To Convert Database to sql 2000

ctgwglzc 2009-9-16 16:48:16 1181
Step 1 Generating Scripts for the Database Elements and Structures



1) Right-click over the desired Database at 2005, Choose Tasks and the Generate Scripts (Option).

2) At the pop-up Dialog Box click at the Script All Objects in the selected Databases check box, to activate it and then Click the Next Button.

3) Set the following Elements to the following Values

a. Script Collation , set to TRUE

b. Script Database Create, set to TRUE

c. Script of SQL Version, set to SQL SERVER 2000

d. Script foreign keys, set to FALSE

e. Script Triggers, set to FALSE

Then Hit the Next button

4) Select the way the generated scripts should be saved (There are different selections. The most common one is Clipboard). Finally click the Next button till you reach the end.

5) Click Finish



After completing this procedure, we have to move to the SQL SERVER 2000 environment. Here, by using the Query Analyzer, we will have to run the scripts that were generated using the master database. Copy and Paste the script at the Query Analyzer and run it. After that the Structure of the Database will be created.



Be careful, the SQL Server 2005 Edition inserts the Views in a random place through the script. Therefore, all the scripts that are referred to the Views MUST be moved to the end of the script. If the Query Analyzer shows some errors do not be bothered. Delete all the elements created from the script and after you fix the code run it again.





Step2 Moving the data from 2005 to 2000



1) After completing the previous step successfully, moving the data follows. Right-click at the 2005 database you used to run the previous step and select Tasks and then choose the Export Data (option).

2) From the pop-up Dialog Box, select the Source Db and Click at the Next Button.

3) At the next step you will have to choose the destination server and the destination Database for the Data to be exported. Then Click Next.

4) A List of all the Source Database’s Elements will appear in the screen. Select one by one all the Elements you wish to move and for each one click at the button Edit Mappings (Located at the bottom right corner of the Dialog Box just under the Elements list). A new Dialog box will pop-up. Select the Delete rows in Destination Tables option and activate the Enable Identity Insert Option. (Remember to repeat this action for each of the selected Element from the list that will be moved.



CAUTION!!! A malfunction of the SQL Server 2005 has been found. Not sure why, after multiple tries I have observed that when I tried to move more than twelve Elements at once, the Export Data Wizard of SQL Server 2005 seemed to disable the Enable Identity Insert Option that was activated over the Edit Mappings Dialog Box. But if the number of the selected Elements is smaller than 12 no problem seemed to appear.



Step 3 Generating Scripts for the Database Foreign Keys and Triggers



Finally, to successfully finish the downgrade of the Database, the Triggers and the Foreign Keys of the DB must be produced. The procedure that should be followed is the one stated next:



1) Right-Click at the SQL 2005 Database and Select from Tasks Menu the Generate Scripts Option.

2) Using the pop-up Dialog Box make sure that the check box Script All Objects in the selected Databases is not enabled and hit the Next Button.

3) Set all the Elements on the List to a False Value except the ones that follow:

a. Include IF NOT EXISTS , set to TRUE

b. Script Owner, set to TRUE

c. Script of SQL Version, set to SQL SERVER 2000

d. Script foreign keys, set to TRUE

e. Script Triggers, set to TRUE

Then Hit the Next button

4) After finishing reading the Elements of the Database, a new list will appear at the Dialog Box. Make sure that you select ONLY THE TABLES of the Database and hit the Next Button.

5) At the screen that follows hit the Select All button and the Next.

6) Select the way the generated scripts should be saved (There are different selections. The most common one is Clipboard). Finally click the Next button till you reach the end.

7) Click Finish Button.



After completing this procedure, we have to move to the SQL SERVER 2000 environment. Here, by using the Query Analyzer, we will have to run the scripts that were generated using the master database. Copy and Paste the script at the Query Analyzer and run it. After that the Foreign Keys and the Triggers of the Database will be created.

3 回复

evaydd
2009-9-15 19:40:30
点击查看详情
看不懂我去翻译下!!!
evaydd
2009-9-15 19:41:47
第1步生成脚本的数据库元素和结构



1)用鼠标在2005年比预期的数据库单击,选择任务和生成脚本(选配)。

2)在建立对话框在脚本中的所有对象按选定的数据库复选框弹出,激活它,然后单击下一步按钮。

3)设置下列内容为下列值

字母a.脚本排序规则,设置为TRUE

湾脚本数据库创建,设置为TRUE

角脚本的SQL版本,设置为SQL Server 2000

d.脚本外键,设置为FALSE

大肠杆菌触发器脚本,设置为FALSE

然后点击下一步按钮

4)选择生成的脚本应保存方法(有不同的选择。最常见的原因是剪贴板)。最后,直到你点击下一步按钮到达终点。

5)按完成



在完成这个过程,我们要继续到SQL Server 2000环境。在这里,通过使用查询分析器,我们将不得不运行那些使用主生成数据库脚本。复制并粘贴到查询分析器脚本并运行它。之后,该数据库结构将被创建。



小心,在SQL Server 2005版中插入一个随机有何意见通过脚本。因此,所有的脚本,被称为必须转移到脚本的结束意见。如果查询分析器显示了一些错误不被人打扰。删除所有从脚本创建的元素和修复后,再次运行它的代码。





步骤2移动2005至2000年的数据



在完成上一步成功,移动数据1)如下。右键单击在2005年的数据库,您用于运行上一步,并选择任务,然后选择导出数据(选项)。

2从弹出对话框弹出),选择源分贝的下一个按钮,然后单击。

3)在下一步,我们将不得不选择目标服务器和目标数据库的数据要导出。然后单击下一步。

4)所有源数据库的元素列表将出现在屏幕上。选择一个所有元素您想移动,并为每个按钮编辑映射一次点击(在对话框的右下角不到的元素的列表1)。一个新的对话框会弹出。选择目标表中选择删除行和激活启用标识插入选项。 (记住要重复这个从将要提出的名单中挑选元素每个动作。



注意!阿的SQL Server 2005故障已被发现。不知道为什么,多次尝试之后,我观察到,当我想马上采取行动超过12个元件,出口数据向导的SQL Server 2005似乎禁用启用标识插入选项,在资源编辑映射对话框激活。但如果所选的元素数小于12,似乎没有任何问题出现。



第3步生成脚本的数据库外键和触发器



最后,为了成功地完成了数据库的触发器和数据库中储存的外键降级必须生产。所应遵循的程序是下一个说:



1)用鼠标在SQL 2005数据库和选择任务菜单中单击生成脚本选项。

2)使用弹出对话框确保脚本所有选定的数据库对象复选框未启用并点击下一步按钮。

3)设置名单上的所有元素为False值的除外遵循:

字母a.包括不存在时设置为TRUE,

湾脚本所有者,设置为TRUE

角脚本的SQL版本,设置为SQL Server 2000

d.脚本外键,设置为TRUE

大肠杆菌触发器脚本,设置为TRUE

然后点击下一步按钮

4)在完成阅读的数据库,一个新的清单将显示在对话框中的元素。确保您只选择的数据库表和打击下一步按钮。

5)在屏幕后面击中全选按钮和下一步。

6)选择生成的脚本应保存方法(有不同的选择。最常见的原因是剪贴板)。最后,直到你点击下一步按钮到达终点。

7)单击Finish按钮。



在完成这个过程,我们要继续到SQL Server 2000环境。在这里,通过使用查询分析器,我们将不得不运行那些使用主生成数据库脚本。复制并粘贴到查询分析器脚本并运行它。在这以后,外键和数据库的触发器将被创建
knight1226
2009-9-16 16:48:16
收藏并学习了。谢谢!
高级模式
游客