Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewing Tables While Writing Stored Procedures... 1

Status
Not open for further replies.

Rebies

Programmer
Mar 7, 2002
58
US
I'm getting into writing quite a few stored procedures from within Enterprise Manager. However, if I want to reference a table, I can not switch between views, tables and other stored procedures while a stored procedure is open.

Is there a way around this? Or how do you guys write stored procedures? From SQL Query Analyzer? From some other means?

Any info would be appreciated, as I am still fairly new at SQL, but am just starting to learn about the entire package.

Andrew
 
I prefer Query Analyzer. It includes an object browser to let you scroll through objects on the server. There are even templates included for assistance in quickly writing stored procedures. And I can open a second query window and test the procedure I'm writing.
--Angel
-----------------------------------
SELECT * FROM users WHERE clue > 0
(0 row(s) affected)
 
Hmmm, thats neat. I had never played with the Object Browser before. Makes it a bit easier to do a lot of different things at a time. (including seeing triggers, constraints and dependencies)

I wonder why there are two fairly main, but different ways of writing stored procedures...?

Andrew
 
Yeah that is a nuisance. I develop my stored procs in Query Analyzer and paste 'em into the new stored procedure once I get it to work. You can't close the sp window with errors in the sp anyway and if you are in the middle of something and you want to go to lunch or take a break you are stuck.

But aside from that, you will kick yourself when you read this, if you need to look at database structure while the sp window is open, open a second instance of EM. Windows is good for something.
;-)
 
Oh ya, I forgot my thanks..

Thanks Angel! Thats the exact sort of answer I would not have known myself.

Andrew
 
rac2:

You are dead on about having problems when a stored procedure is not finished and you can't close the "Edit Procedure" window.

And I had contemplated opening a new Enterprise Manager, but knew there had to be a better way!

Andrew
 
AND SQL 2000 even has a debugger in Query Analyzer and you can make the window larger. And a feature I only recently found out about is that you can drage column names from the object browser to the stored procedure you are writing. No more misspelllings!!! (Perhaps I need to learn how to spell misspellings, oops!)

I admit, I do sometimes write stored procedures in Enterprise Manager anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top