开发者

helptext for create table

开发者 https://www.devze.com 2023-02-14 00:52 出处:网络
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.

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?


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消