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 I'm not finding anything.
This also works just as good as the accepted answer, thanks.
rosscj2533
2009-12-07 19:43:27
+3
A:
Have you had a look at sp_helptext?
SQL SERVER – Stored Procedure to display code (text) of Stored Procedure, Trigger, View or Object
astander
2009-12-07 19:27:07
+1
A:
It's in sys.sql_modules. Other schema tables like INFORMATION_SCHEMA ones only contain the first 4000 characters of the definition (they truncate).
Remus Rusanu
2009-12-07 19:27:47