如何使用“脚本表为” ,“创建表” sql管理工作室中的脚本
我想获取所有表的“CREATE”脚本。
有没有像 sp_helptext 这样的脚本?
当“脚本表为”-> 时如何调用脚本“创建表” 被选中?
I want to get the "CREATE" script for all tables.
Is there any script, like sp_helptext?
How can I get the script called when "Script Table as" -> "Create table"
is selected?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以右键单击数据库并转到“任务”->“任务”生成脚本。
这将引导您编写所需的所有脚本。
You can right click on the database and go to Tasks -> Generate Scripts.
This will walk you through scripting out all of the scripts you want.
您可以使用 SQL Server 中的“生成脚本”选项。
在那里您可以根据需要使用脚本。
You may use Generate script option in SQL Server.
There you can take script as your needs.
您可以使用 Stefan 和 gbn 的建议。此外,如果您想要数据库的精确副本的脚本,请查看 Microsoft SQL Server 数据库发布向导。它内置于 VS 2008 +
You could use what Stefan and gbn have suggested. Additionally if u want scripts for the exact replica for ur DB then look at Microsoft SQL Server Database Publishing Wizard. It comes built into VS 2008 +
已经有人给出了这个问题的正确答案
,但是由于某些原因您被指出无法使用该方法。
如果您正在寻找使用查询的方法,那么您可以采用以下方法,它将返回表的架构,
您可以调用您的函数,例如
Extension :
如果您也需要数据,那么您可以使用以下方法询问
Already somebody give the right answer to this question
But you are point out because of some reasons you cannot use the method.
if you are looking for a method using query then you can take the below method it will return the schema of your table
you can call your function like
Extension :
if you need data too then you can use the following query