Solved

Cant update a SP

Posted on 2009-05-17
6
232 Views
Last Modified: 2012-05-07
Hi - I'm no SQL guru but I had a database running a website that was SQL 2000 - I could create and update SPs no problem in it. My host upgraded to 2008 - when I go into Programability and SPs and chose to modify a SP - it keeps on prompting me to save is somewhere else when I click save.

It's a simple SP to delete some records after a period of time...

Also - I can't seem to create one as I used to in 2000. It again asks me to save it as a file rather than add it to the list of SPs in Management Studio...

Am I missing something really simple here?


USE [agoy]

GO

/****** Object:  StoredProcedure [dbo].[sp_delete_oldemailtohosts]    Script Date: 05/17/2009 23:09:03 ******/

SET ANSI_NULLS OFF

GO

SET QUOTED_IDENTIFIER OFF

GO

ALTER procedure [dbo].[sp_delete_oldemailtohosts]
 

AS

BEGIN
 

DELETE

FROM         EmailsToHosts

WHERE     (EmailDate < DATEADD([month], - 3, GETDATE()))
 

end

Open in new window

0
Comment
Question by:craig32768
  • 4
  • 2
6 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
> it keeps on prompting me to save is somewhere else
you have to RUN the sql (alter proc), and not SAVE it (to file).
0
 

Author Comment

by:craig32768
Comment Utility
Thanks...that worked.  How about creating a new one - in Enterprise Manager for SQL 2000 - I used to click and create a new SP - and it would appear in the SP file tree - in 2008 it doesn't seem to do that?
0
 

Author Comment

by:craig32768
Comment Utility
AngelIII - I really need to get to grips with SQL 2008 - can you recommend any books for 'beginners' :-) ?
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
>How about creating a new one
open a query window, and run a CREATE PROCEDURE statement ...

>can you recommend any books for 'beginners' :-) ?
sorry, I didn't need any books ...
0
 

Author Comment

by:craig32768
Comment Utility
OK - thanks - Guess that's why your a 'Genius' ;-)
0
 

Author Closing Comment

by:craig32768
Comment Utility
Thanks - much appreciated
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now