Home All Groups Group Topic Archive Search About

modifying stored procedure with SSMSE

Author
30 Dec 2005 3:40 PM
Jesper F
I have a MSSQL 2000 db that was imported into SQL2005.
I use the Management Studio to administer the database.
When I modify a stored procedure and hit "save" I'm asked to save a file
called something like "SQLQuery10.sql" to a place on my own harddrive!? I
wan't to save the sp on the server for immediate use just like MSSQL2000
did.
What am I missing here?

Thanks.

Jesper

Author
30 Dec 2005 5:03 PM
Michael Hotek
Um....hope about executing the code in your query window?

--
Mike
Mentor
Solid Quality Learning
http://www.solidqualitylearning.com


Show quote
"Jesper F" <askfortheem***@ask.com> wrote in message
news:eVt4XdVDGHA.1180@TK2MSFTNGP09.phx.gbl...
>I have a MSSQL 2000 db that was imported into SQL2005.
> I use the Management Studio to administer the database.
> When I modify a stored procedure and hit "save" I'm asked to save a file
> called something like "SQLQuery10.sql" to a place on my own harddrive!? I
> wan't to save the sp on the server for immediate use just like MSSQL2000
> did.
> What am I missing here?
>
> Thanks.
>
> Jesper
>
Author
30 Dec 2005 5:09 PM
Rick Byham [MS]
If you right-clicked the stored procedure and then clicked modifiy, then you
will see the script in the Query Editior window is an ALTER PROC statement.
Instead of hitting Save, click Execute. That will alter the procedure.
--
Rick Byham
MCDBA, MCSE, MCSA
Lead Technical Writer,
Microsoft, SQL Server Books Online
This posting is provided "as is" with
no warranties, and confers no rights.

Show quote
"Jesper F" <askfortheem***@ask.com> wrote in message
news:eVt4XdVDGHA.1180@TK2MSFTNGP09.phx.gbl...
>I have a MSSQL 2000 db that was imported into SQL2005.
> I use the Management Studio to administer the database.
> When I modify a stored procedure and hit "save" I'm asked to save a file
> called something like "SQLQuery10.sql" to a place on my own harddrive!? I
> wan't to save the sp on the server for immediate use just like MSSQL2000
> did.
> What am I missing here?
>
> Thanks.
>
> Jesper
>
Author
30 Dec 2005 6:06 PM
Jesper F
> If you right-clicked the stored procedure and then clicked modifiy, then
> you will see the script in the Query Editior window is an ALTER PROC
> statement. Instead of hitting Save, click Execute. That will alter the
> procedure.

I was wondering about the "ALTER" part.
Getting used to the new functions I guess.
Thanks a lot!


Jesper
Author
30 Dec 2005 10:00 PM
Jesper F
> If you right-clicked the stored procedure and then clicked modifiy, then
> you will see the script in the Query Editior window is an ALTER PROC
> statement. Instead of hitting Save, click Execute. That will alter the
> procedure.

Is there a way to just open up the the sp for modyfication and saving it
back to the database or is using the ALTER command the only way to modify
sp's?
Author
19 Jan 2006 8:30 PM
gold
Hello
Good question and what is the answer ?

Was it too simple ?



"Jesper F" <askfortheem***@ask.com> a écrit dans le message de news:
uavDjyYDGHA.3***@TK2MSFTNGP12.phx.gbl...
Show quote
>> If you right-clicked the stored procedure and then clicked modifiy, then
>> you will see the script in the Query Editior window is an ALTER PROC
>> statement. Instead of hitting Save, click Execute. That will alter the
>> procedure.
>
> Is there a way to just open up the the sp for modyfication and saving it
> back to the database or is using the ALTER command the only way to modify
> sp's?
>
>
>
Author
20 Jan 2006 10:30 AM
Jesper F
> Good question and what is the answer ?
>
> Was it too simple ?

It is actually very simple, I just needed help from the guys in here to
figure it out.

What's different i SQL2005 is that when you open a stored procedure, it
doesn't open up the way you created it.
That is - it doesn't say "create procedure....." anywhere in it.

Instead it says "alter procedure....".

You make your changes and you hit the button "execute" in the toolbar.
That automatically saves the procedure to the database.
So in effect you're using the SQL command "ALTER" to change your stored
procedure.
This works just like hitting "save" in MSSQL2000.
It's cool, but it took me a while to get the difference.
Let me know if this is enough to get you going.

Jesper
Author
20 Jan 2006 5:44 PM
gold
well, it is clear now...

I really appreciate your answer, which is better than clear

amicalement  Jacques

"Jesper F" <askfortheem***@ask.com> a écrit dans le message de news:
ezqEnyaHGHA.2***@TK2MSFTNGP15.phx.gbl...
Show quote
>> Good question and what is the answer ?
>>
>> Was it too simple ?
>
> It is actually very simple, I just needed help from the guys in here to
> figure it out.
>
> What's different i SQL2005 is that when you open a stored procedure, it
> doesn't open up the way you created it.
> That is - it doesn't say "create procedure....." anywhere in it.
>
> Instead it says "alter procedure....".
>
> You make your changes and you hit the button "execute" in the toolbar.
> That automatically saves the procedure to the database.
> So in effect you're using the SQL command "ALTER" to change your stored
> procedure.
> This works just like hitting "save" in MSSQL2000.
> It's cool, but it took me a while to get the difference.
> Let me know if this is enough to get you going.
>
> Jesper
>
Author
31 Dec 2005 3:43 PM
Erland Sommarskog
Jesper F (askfortheem***@ask.com) writes:
> I have a MSSQL 2000 db that was imported into SQL2005.
> I use the Management Studio to administer the database.
> When I modify a stored procedure and hit "save" I'm asked to save a file
> called something like "SQLQuery10.sql" to a place on my own harddrive!? I
> wan't to save the sp on the server for immediate use just like MSSQL2000
> did.
> What am I missing here?

You don't save the procedure to the database. You should view a database
a repository for binaries. Source code should be stored on disk, preferrably
in a source-code control system.

No, this was no the way that Enterprise Manager in SQL 2000 worked, but
then again, that was a tool with many problem, including a flaw model
for handelling source code. Mgmt Studio is certainly a leap forward in
this regard.


--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button