且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将所有mdb表复制到新的mdb文件

更新时间:2023-02-03 16:01:52

MS SQL Management Studio内部

1-右键单击您的数据库
2-任务->生成脚本
3-按照弹出窗口中出现的步骤进行操作(选择全部",它将选择您的所有表,视图,过程等)
4-选择在您指定的任何位置生成文件

5-打开该文件
6-进入该文件,然后用新的数据库名称替换您的数据库名称...,即,将[MyDB]替换为[MyDB2]

7-这是一个完整的查询,可以生成具有相同数据库模式的新数据库.
8-只需运行该查询和数据库[MyDB]的克隆,并准备好使用名称[MyDB2]
Inside MS SQL Management Studio

1- Right Click your Database
2- Tasks - > Generate Script
3- follow the steps appeared to you in pop-up (choose to select All, it will select all of your tables, views, procedures etc)
4- choose to generate file at any of your specified location

5- open that file
6- go into that file and replace your database name with new database name... i.e Replace [MyDB] to [MyDB2]

7- it is a complete query to generate new database with same database schema.
8- Just run that query and a clone of your database [MyDB] with be ready for you with name [MyDB2]