Solved

Query

Posted on 2013-11-14
6
164 Views
Last Modified: 2013-12-13
Hi,

I need to know who updated the SProc and SQL Job last month.
Thanks
0
Comment
Question by:SanPrg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 12

Expert Comment

by:Tony303
ID: 39650035
For the SProc question.


In SSMS, right click on DB (or Server), choose Reports / Standard Reports / Schema Changes History.

Hopefully the data goes back far enough to last month.

T
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 39650299
Hi SanPrg

Finding the list of Stored Procedures modified and created for last x days is also possible using sql query
-- Stored Procedures MODIFIED within 7 days 
SELECT name
 FROM sys.objects
 WHERE type = 'P'
 AND DATEDIFF(D,modify_date, GETDATE()) < 7

-- Stored Procedures CREATED within 7 days 
SELECT name
 FROM sys.objects
 WHERE type = 'P'
 AND DATEDIFF(D,create_date, GETDATE()) < 7

Open in new window


Raj
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 39650305
To get the list of Jobs modified in last 100 days, use the below query

select s.name,l.name, s.date_created, s.date_modified
 from  msdb..sysjobs s 
 left join master.sys.syslogins l on s.owner_sid = l.sid
 where DATEDIFF(D, s.date_modified, GETDATE()) < 100

Open in new window


Raj
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:SanPrg
ID: 39650339
Hi Raj,
So far it's good but I need to know who modified SProc and Jobs.
0
 
LVL 23

Accepted Solution

by:
Rajkumar Gs earned 500 total points
ID: 39650471
Hi

For Jobs, not sure this is the modified user
select s.name,l.name user_modified, s.date_modified
 from  msdb..sysjobs s 
 left join master.sys.syslogins l on s.owner_sid = l.sid
 where DATEDIFF(D, s.date_modified, GETDATE()) < 100

Open in new window

0
 

Author Closing Comment

by:SanPrg
ID: 39718208
Thanks
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to shrink a transaction log file down to a reasonable size.

739 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