SQL Server: How to edit a view without scripting it?
Maybe you could give us a hint as to what the aforementioned "easy-to-use tools from Microsoft" were?
There is a View Designer in SSMS as an option. In Object Explorer, right-click a view, click Design
or right-click the Views node and click New View...
, but it is a bit limited. If your views are at all complex (ie- much beyond simple JOINs) you're pretty much going to be scripting it.
Related videos on Youtube
Comments
-
Mark over 1 year
How can i edit the definition of a
view
without having to "script" it in SSMS?The previous easy-to-use tools from Microsoft let me:
- Enter
- wait a moment
- Make change
- Carefully move mouse to large
OK
button - Click
OK
- Down Arrow
goto 1
With SSMS i've having a much more tedious time of it:
- Carefully move mouse to small view to script
- Right-click
- wait a moment
- Carefully move mouse to small menu option
Script View as
- Carefully move mouse to small menu option
ALTER TO
- Carefully move mouse to small menu option
New Query Editor Window
- wait a moment
- Press
F5
- Carefully move mouse to tiny
x
icon - Click close button
- Carefully move mouse to large
No
button - Click
No
goto 1
i'm really not interested in scripting my view to a new query editor window. i want to edit the view definition. Microsoft seemed to implement editing the definition of a view by resorting to an
ALTER VIEW
in a new query window.Is there a way to view/edit the definition of (a lot) of views, without having to resort to the UI tedium introduced with SQL Server Management Studio?
-
Seth Spearman over 12 yearsI'm curious what "easy-to-use" tools you are talking about?
-
Mark over 12 years@Joel Coel: If i don't close the tabs then after 5 or 6 dozen SSMS really begins to get sluggish.
-
Mark over 12 years@Seth Spearman: msdn.microsoft.com/en-us/library/aa215396(v=sql.80).aspx
-
squillman over 12 yearsWhat @Joel is trying to say is, instead of opening a new window every time you make your changes in the same window and hit F5. You don't need to reopen the view every time you want to make a change to it.
-
squillman over 12 years@Ian Ah, that makes more sense now!
-
Mark over 12 yearsDesigner modifies the formatting, and removes comments, from views.
-
Mark over 12 yearsIt doesn't matter, or affect the question, or answer. It's a tool that SQL Server 2005 refuses to accept a connection from. And since it's not supported since 2002, and has not been updated for 64-bit Windows, i can no longer run it without
Windows XP Mode
. Finally, the view designer modifies view definition formatting, and removes comments. -
Wil over 12 yearsHe more than likely, by his description, was previously using some kind of designer and made no mention of retaining formatting or comments ;)