导出 MS SQL 架构和数据
我已经习惯了 MySQL 和 PHPMyAdmin - 我不得不切换到 MSSQL 来处理 ASP.net 项目,而且我遇到了很多麻烦。我使用的是带有 SQL Server Management Studio 的 SQL 2008 Express 版本。以下是我一段时间以来一直困扰的两个问题:
1)如何导出数据库的数据库架构?表结构等?
2)如何导出数据库中的所有数据?
理想情况下,我希望有一个 .sql 文件,可以在需要复制模式或数据的任何地方运行,例如用于共享项目的同事计算机,或者在托管项目时在线运行。
谢谢!
I'm used to MySQL and PHPMyAdmin - I had to switch over to MSSQL for an ASP.net project, and I'm having tons of trouble. I'm using the express version of SQL 2008, with SQL Server Management Studio. The following are 2 questions I've been struggling with for a while:
1) How do I export the DB schema for the database? The table structure, etc.?
2) How do I export all the data in the database?
Ideally I'd like to have a .sql file that can be run wherever I need the schema or data duplicated, for example a co-worker's computer for a shared project, or online when the project is being hosted.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1) 如何导出数据库的数据库架构?表结构等?
INFORMATION_SCHEMA是你的朋友
http://www .mssqltips.com/tutorial.asp?tutorial=179
http://weblogs.asp.net/jgalloway/archive/ 2006/07/07/455797.aspx
http://preetul.wordpress.com/2009/06/09 /sql-server-information_schema/
否则,如果您想要漂亮的东西,请在此处下载 SQL Doc(SQL Toolbelt 的一部分)的 14 天试用版:
http://www.red-gate.com/products/SQL_Professional_Toolbelt/index.html htm
“2)如何导出数据库中的所有数据?”
以什么形式导出? .bak 文件通常是最有用的。 http://www.sqlteam.com/文章/sql-server-full-backups 中的备份和恢复
或者您是否希望将数据移至 MYSQL 或 Excel 或其他程序中?如果您想将数据移至 MYSQL,请检查此处:http://www.google .com/search?q=mssql+to+mysql
1) How do I export the DB schema for the database? The table structure, etc.?
INFORMATION_SCHEMA is your friend
http://www.mssqltips.com/tutorial.asp?tutorial=179
http://weblogs.asp.net/jgalloway/archive/2006/07/07/455797.aspx
http://preetul.wordpress.com/2009/06/09/sql-server-information_schema/
Otherwise, if you want something pretty looking, download the 14 day trial of SQL Doc (part of SQL Toolbelt) here:
http://www.red-gate.com/products/SQL_Professional_Toolbelt/index.htm
"2) How do I export all the data in the database?"
In what form? .bak files are typically the most useful. http://www.sqlteam.com/article/backup-and-restore-in-sql-server-full-backups
Or were you looking to move the data into MYSQL or Excel or some other program? If you want to move data to MYSQL check here: http://www.google.com/search?q=mssql+to+mysql