Sql Server - Get view creation statement for existing view

前端 未结 6 830
灰色年华
灰色年华 2021-02-06 03:48

Is there a way to get the statement that created a view for an existing view in SQL Server 2008? I thought there was a stored procedure or some metadata that had this data, but

6条回答
  •  你的背包
    2021-02-06 04:50

    Have you had a look at sp_helptext?

    sp_helptext 'dbo.name_of_view'
    

    SQL SERVER – Stored Procedure to display code (text) of Stored Procedure, Trigger, View or Object

提交回复
热议问题