创建表的帮助文本
我可以获得用于创建表的整个查询,就像我们有 sp_helptext 来获取存储过程的查询一样。
sp_helptext 'procedure_name'
是否有类似的东西可用于在 SQL Server Express 中创建表?
我想查看我为创建特定表而编写的整个查询,而不是表结构。
就像如果删除了一个表,并再次想要创建它,那么我将不得不再次输入整个查询,所以我想要一种方法,通过它我不必再次编写整个查询,就像在 mysql 中一样选项如SHOW,它显示表查询?
Can I get the whole query which I used for creating a table, like we have sp_helptext to get the query of a stored procedure.
sp_helptext 'procedure_name'
Is there anything like this available for create table also in SQL server express?
I want to view the whole query which I wrote for creating a particular table and not the table structure.
Like if a deleted a table, and again want to create it, then I would have to type the whole query again, so I want a way through which I don't have to write the whole query again, like in mysql there is an option such as SHOW, which shows the table query?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 SQL Server Management Studio 中 您可以右键单击对象资源管理器窗口中的表,然后选择将 CREATE 脚本生成到新的查询窗口中或将其放入剪贴板或保存在文件中。
In SQL Server Management Studio you can right-click on a table in the Object Explorer window and choose to generate the CREATE script into a new query window or put it in the clipboard or save it in a file.
尝试 sp_columns 或 sp_help。但这不会为您提供
CREATE TABLE
文本,您必须自己创建此文本。您还可以查看目录存储过程< /a>
Try sp_columns or sp_help. But this will not give you the
CREATE TABLE
text, you have to create this text for yourself.You can also have a look at Catalog Stored Procedures