I have a view which if i try to edit, MS SQL Server Management Studio crashes (the view contains a pivot function).
Is there a way i can view the sql that is inside the view without crashing MS SQL Server Management Studio?
I have a view which if i try to edit, MS SQL Server Management Studio crashes (the view contains a pivot function).
Is there a way i can view the sql that is inside the view without crashing MS SQL Server Management Studio?
Try this query - work on SQL Server 2005 and up:
SELECT
v.name ,
m.definition
FROM
sys.views v
INNER JOIN
sys.sql_modules m ON v.object_id = m.object_id
What version of SQL Management Studio?
In 2008 I do the following:
Right click on the view
Select "Script view as..."
"Create to..." or "Alter to..."
"New query window"