May 20, 2009 at 4:43 pm
We have tons of views and procedures. It seems like it takes forever to find so I can open and modify. Scrolling up and down, up and down, up and down
Is there a command to open view or procedure in Query analyzer?
For example if I type...."Modify View MyView"...in query analyzer
MyView opens in query analyzer.
May 20, 2009 at 9:44 pm
Unfortunately, no. Something like that just might be useful but not sure how it would be implemented.
May 20, 2009 at 9:48 pm
I'm with you on this one. I've long wished for a way to group objects in SSMS by name, category, etc. Databases with hundreds or even thousands of objects can cost you a lot of time just finding your object in the browser.
A quick and dirty way to see your object text is to call sp_helptext, which will return the text of the view/sproc.
EXEC sp_helptext([object_name])
hth,
Tim
Tim Mitchell, Microsoft Data Platform MVP
Data Warehouse and ETL Consultant
TimMitchell.net | @Tim_Mitchell | Tyleris.com
ETL Best Practices
May 20, 2009 at 10:06 pm
I use sp_helptext and then I copy the text from the results pan to the query pan. One thing that I do at every place that I work is to define a keyboard shortcut for sp_helptext, sp_help, sp_spaceused. This way when I check the code of a stored procedure and it references a view or another piece of code, I can just mark the name of the view/other piece of code and use the keyboard to see that code in the results pane. I can also see a query in the code and mark a table name and then check the table’s size and structure by running through the keyboard sp_spaceused and sp_help.
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
May 20, 2009 at 10:43 pm
computer.mike (5/20/2009)
For example if I type...."Modify View MyView"...in query analyzerMyView opens in query analyzer.
hi,
Also try this option,
create this as your own sp and kept it in shortcut key to execute
CREATE PROC Sp_Modify_View
(
@tabname_tmp VARCHAR(50)
)
AS
BEGIN
create table #temp (text1 varchar(max))
insert into #temp
exec sp_helptext @tabname_tmp
--select replace(text1,'CREATE procedure','ALTER procedure')from #temp
select replace(text1,'CREATE VIEW','ALTER View')from #temp
END
ARUN SAS
May 21, 2009 at 3:26 am
Hi,
You can use Filter option so you dont have to too much scroll up and down.
May 21, 2009 at 5:10 am
The filter option works, but it's only static for a single session. When you close and reopen SSMS, the filter is gone.
Tim Mitchell, Microsoft Data Platform MVP
Data Warehouse and ETL Consultant
TimMitchell.net | @Tim_Mitchell | Tyleris.com
ETL Best Practices
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply