Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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:

  1. Enter
  2. wait a moment
  3. Make change
  4. Carefully move mouse to large OK button
  5. Click OK
  6. Down Arrow
  7. goto 1

With SSMS i've having a much more tedious time of it:

  1. Carefully move mouse to small view to script
  2. Right-click
  3. wait a moment
  4. Carefully move mouse to small menu option Script View as
  5. Carefully move mouse to small menu option ALTER TO
  6. Carefully move mouse to small menu option New Query Editor Window
  7. wait a moment
  8. Press F5
  9. Carefully move mouse to tiny x icon
  10. Click close button
  11. Carefully move mouse to large No button
  12. Click No
  13. 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?

share|improve this question
    
I'm curious what "easy-to-use" tools you are talking about? –  Seth Spearman Sep 16 '11 at 20:25
1  
Steps 9 to 13 are off. If you're doing step thirteen, just stop before step 9. –  Joel Coel Sep 16 '11 at 20:27
    
@Joel Coel: If i don't close the tabs then after 5 or 6 dozen SSMS really begins to get sluggish. –  Ian Boyd Sep 16 '11 at 20:48
    
@Seth Spearman: msdn.microsoft.com/en-us/library/aa215396(v=sql.80).aspx –  Ian Boyd Sep 16 '11 at 20:49
    
What @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 Sep 16 '11 at 20:54

2 Answers 2

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.

share|improve this answer
    
It 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. –  Ian Boyd Sep 19 '11 at 13:05
  1. Right click on the view.
  2. Left click on Design
  3. Make your changes in the query window.
  4. Close the designer and click on any prompts that come up
share|improve this answer
    
Designer modifies the formatting, and removes comments, from views. –  Ian Boyd Sep 16 '11 at 20:49
    
He more than likely, by his description, was previously using some kind of designer and made no mention of retaining formatting or comments ;) –  Wil Sep 21 '11 at 19:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.