Home All Groups Group Topic Archive Search About

Stored Procedure Development

Author
4 Nov 2005 2:19 PM
Art
Hi,

I'm very new to SQL Server 2000.  I'm wondering what the best way to write
stored procedures are.

Currently I go into Enterprise Manager, double click the procedure and then
code.  It's been working okay, except that I'm missing a bunch of stuff that
would be helpful. For example Find and Replace.  Also, I can't seem to have 2
of them open at the same time.

I can't figure out how to open them up in Query Analyzer.  I assume that
people that do a lot of this must use a better environment.  Can anyone
suggest anything?

Also, I probably will move to SQL Server 2005 as soon as I can -- does this
offer more?

One final thing.  I do have Visual Studio, but on a different server.  Does
this give me any options?

              Thanks for any advice you can offer,

               Art

Author
4 Nov 2005 2:25 PM
Aaron Bertrand [SQL Server MVP]
> I can't figure out how to open them up in Query Analyzer.

Press F8 to show the Object Browser.  Expand your database, expand stored
procedures, find your procedure, right-click, edit.

> Also, I probably will move to SQL Server 2005 as soon as I can -- does
> this
> offer more?

Yes, for one, a consolidated tool, Management Studio, which combines the
functionality of Query Analyzer and Enterprise Manager.  As I'm learning,
unfortunately, it kept around a lot of the bad behaviors of Enterprise
Manager.

A
Author
4 Nov 2005 2:47 PM
Art
Aaron,

Thanks -- but I'm left with a new question:  Once I edit my query I can't
figure out how to save it.  It wants to save it in the file system as a .SQL
file.  Is there a way to just put the revised query back into my stored
procedures?

     Thanks,

      Art

Show quote
"Aaron Bertrand [SQL Server MVP]" wrote:

> > I can't figure out how to open them up in Query Analyzer.
>
> Press F8 to show the Object Browser.  Expand your database, expand stored
> procedures, find your procedure, right-click, edit.
>
> > Also, I probably will move to SQL Server 2005 as soon as I can -- does
> > this
> > offer more?
>
> Yes, for one, a consolidated tool, Management Studio, which combines the
> functionality of Query Analyzer and Enterprise Manager.  As I'm learning,
> unfortunately, it kept around a lot of the bad behaviors of Enterprise
> Manager.
>
> A
>
>
>
Author
4 Nov 2005 3:29 PM
Alejandro Mesa
Art,

You hav to execute (F5) the script so the "alter procedure" statement can be
executed.


AMB

Show quote
"Art" wrote:

> Aaron,
>
> Thanks -- but I'm left with a new question:  Once I edit my query I can't
> figure out how to save it.  It wants to save it in the file system as a .SQL
> file.  Is there a way to just put the revised query back into my stored
> procedures?
>
>      Thanks,
>
>       Art
>
> "Aaron Bertrand [SQL Server MVP]" wrote:
>
> > > I can't figure out how to open them up in Query Analyzer.
> >
> > Press F8 to show the Object Browser.  Expand your database, expand stored
> > procedures, find your procedure, right-click, edit.
> >
> > > Also, I probably will move to SQL Server 2005 as soon as I can -- does
> > > this
> > > offer more?
> >
> > Yes, for one, a consolidated tool, Management Studio, which combines the
> > functionality of Query Analyzer and Enterprise Manager.  As I'm learning,
> > unfortunately, it kept around a lot of the bad behaviors of Enterprise
> > Manager.
> >
> > A
> >
> >
> >
Author
4 Nov 2005 3:46 PM
Art
Alejandro,

Thanks very much -- I'm sure it's obvious but this is very new to me.

           Art

Show quote
"Alejandro Mesa" wrote:

> Art,
>
> You hav to execute (F5) the script so the "alter procedure" statement can be
> executed.
>
>
> AMB
>
> "Art" wrote:
>
> > Aaron,
> >
> > Thanks -- but I'm left with a new question:  Once I edit my query I can't
> > figure out how to save it.  It wants to save it in the file system as a .SQL
> > file.  Is there a way to just put the revised query back into my stored
> > procedures?
> >
> >      Thanks,
> >
> >       Art
> >
> > "Aaron Bertrand [SQL Server MVP]" wrote:
> >
> > > > I can't figure out how to open them up in Query Analyzer.
> > >
> > > Press F8 to show the Object Browser.  Expand your database, expand stored
> > > procedures, find your procedure, right-click, edit.
> > >
> > > > Also, I probably will move to SQL Server 2005 as soon as I can -- does
> > > > this
> > > > offer more?
> > >
> > > Yes, for one, a consolidated tool, Management Studio, which combines the
> > > functionality of Query Analyzer and Enterprise Manager.  As I'm learning,
> > > unfortunately, it kept around a lot of the bad behaviors of Enterprise
> > > Manager.
> > >
> > > A
> > >
> > >
> > >
Author
4 Nov 2005 3:29 PM
Aaron Bertrand [SQL Server MVP]
> Thanks -- but I'm left with a new question:  Once I edit my query I can't
> figure out how to save it.  It wants to save it in the file system as a
> .SQL
> file.  Is there a way to just put the revised query back into my stored
> procedures?

It is an ALTER PROCEDURE command.  You do not "save" it, you run it.  Press
F5 or the little green arrow.
Author
4 Nov 2005 3:46 PM
Art
Aaron,

Thanks very much!  I guess I'll get used to this sooner or later.

             Art

Show quote
"Aaron Bertrand [SQL Server MVP]" wrote:

> > Thanks -- but I'm left with a new question:  Once I edit my query I can't
> > figure out how to save it.  It wants to save it in the file system as a
> > .SQL
> > file.  Is there a way to just put the revised query back into my stored
> > procedures?
>
> It is an ALTER PROCEDURE command.  You do not "save" it, you run it.  Press
> F5 or the little green arrow.
>
>
>
>
Author
4 Nov 2005 3:30 PM
Aaron Bertrand [SQL Server MVP]
(Of course, it is never a bad idea to use some type of Source Control for
these things, so maybe in addition to running the ALTER PROCEDURE command
you also save a copy of it somewhere in your repository.)

AddThis Social Bookmark Button