Stored Proc Contents Missing

I created a large stored proc a couple of days ago and it had been running fine and updating my tables as intended.  I noticed this morning, that my data was not being updated via the proc and went into sql 2005 management studio right clicked on the procedure under stored procedures,  .. clicked modify and noticed that the proc had only 10 lines of system generated code with the name of my procedure in it, but none of the sql that I wrote for this procedure.  what has happened, am I missing something???
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jorge_torizResearch & Development ManagerCommented:
mmm... nop, somebody deleted your code... sorry... it just not happens.   SQL Server didn't make that

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
H-SCAuthor Commented:
here is what I see when I click modify....  It also will execute successfully

/****** Object:  StoredProcedure [dbo].[MYSP]    Script Date: 10/16/2008 11:16:40 ******/
ALTER procedure [dbo].[MYSP]
set nocount off
jorge_torizResearch & Development ManagerCommented:
Let me clarify my ideas... did your stored procedure code gone away?... is that the only code that you see when you request a modify script?
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

H-SCAuthor Commented:
yes this is all that I see when I request modify script.
jorge_torizResearch & Development ManagerCommented:
Check this query to see the last time your stored procedure was modified:

SELECT name, create_date, modify_date
FROM sys.objects WHERE name = 'your_stored_procedure_name'
Does any other user have privileges to create or modify stored procedures in your database or schema?
H-SCAuthor Commented:
It has a create date of 2008-10-14 15:53:15.527
and modified date of 2008-10-16 11:32:19.167
jorge_torizResearch & Development ManagerCommented:
Well.. the modified date is just lower that the time you have encountered problems?
H-SCAuthor Commented:
I noticed that as well.  When I have the sp open and click on execute it updates the modified date that is probably the reason.  I ran the sp in its current condition and it updated the modified date
jorge_torizResearch & Development ManagerCommented:
Soooo weird... this date (modify_date) in sys.objects view only updates when you modify the structure of your object
H-SCAuthor Commented:
oh well, looks like I am going to be re-typing my sql!

many thanks for your time
jorge_torizResearch & Development ManagerCommented:
Yep, somebody modified your stored procedure... I can bet for that

Implement a DLL Trigger to audit your changes, catch the group DDL_DATABASE_LEVEL_EVENTS
H-SCAuthor Commented:
ok will do that.

many thanks again for your suggestions
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.