Click here to Skip to main content
15,884,628 members
Home / Discussions / Database
   

Database

 
QuestionWhat is merge join in sql server Pin
Tridip Bhattacharjee23-Mar-17 22:56
professionalTridip Bhattacharjee23-Mar-17 22:56 
AnswerRe: What is merge join in sql server Pin
CHill6023-Mar-17 23:36
mveCHill6023-Mar-17 23:36 
GeneralRe: What is merge join in sql server Pin
Richard MacCutchan24-Mar-17 1:40
mveRichard MacCutchan24-Mar-17 1:40 
GeneralRe: What is merge join in sql server Pin
CHill6028-Mar-17 1:31
mveCHill6028-Mar-17 1:31 
GeneralRe: What is merge join in sql server Pin
Tridip Bhattacharjee27-Mar-17 22:33
professionalTridip Bhattacharjee27-Mar-17 22:33 
GeneralRe: What is merge join in sql server Pin
CHill6028-Mar-17 0:42
mveCHill6028-Mar-17 0:42 
GeneralRe: What is merge join in sql server Pin
Eddy Vluggen28-Mar-17 1:35
professionalEddy Vluggen28-Mar-17 1:35 
QuestionGet all Packages that are failed to execute Pin
indian14321-Mar-17 14:15
indian14321-Mar-17 14:15 
Hi All,

I have an application which reads all the Jobs and its related packages which failed, but its reading only those Packages which are executed as part of the Jobs. Is there any way that I can check all the Packages that are failed like the ones that are executed externally like from an Application or Manually etc.

The code to get the failed packages that are part of the SQL Agent Jobs:
DECLARE @PreviousDate datetime<br />
DECLARE <a href="https://www.codeproject.com/Members/Year">@Year</a> VARCHAR(4)<br />
DECLARE <a href="https://www.codeproject.com/Members/month">@Month</a> VARCHAR(2)<br />
DECLARE @MonthPre VARCHAR(2)<br />
DECLARE <a href="https://www.codeproject.com/Members/Day">@Day</a> VARCHAR(2)<br />
DECLARE @DayPre VARCHAR(2)<br />
DECLARE @FinalDate INT  

-- Initialize Variables<br />
SET @PreviousDate = DATEADD(dd, -1, GETDATE()) -- Last 1 day<br />
SET <a href="https://www.codeproject.com/Members/Year">@Year</a> = DATEPART(yyyy, @PreviousDate)<br />
SELECT @MonthPre = CONVERT(VARCHAR(2), DATEPART(mm, @PreviousDate))<br />
SELECT <a href="https://www.codeproject.com/Members/month">@Month</a> = RIGHT(CONVERT(VARCHAR, (@MonthPre + 1000000000)),2)<br />
SELECT @DayPre = CONVERT(VARCHAR(2), DATEPART(dd, @PreviousDate))<br />
SELECT <a href="https://www.codeproject.com/Members/Day">@Day</a> = RIGHT(CONVERT(VARCHAR, (@DayPre + 1000000000)),2)<br />
SET @FinalDate = CAST(@Year + <a href="https://www.codeproject.com/Members/month">@Month</a> + <a href="https://www.codeproject.com/Members/Day">@Day</a> AS INT)  

-- Final Logic 

SELECT   h.instance_id, j.[name],  
         s.step_name,  
         h.step_id,  
         h.step_name,  
         h.run_date,  
         h.run_time,  
         h.sql_severity,  
         h.message,   
         h.server  
FROM     msdb.dbo.sysjobhistory h  
         INNER JOIN msdb.dbo.sysjobs j  
           ON h.job_id = j.job_id  
         INNER JOIN msdb.dbo.sysjobsteps s  
           ON j.job_id = s.job_id 
           AND h.step_id = s.step_id  
WHERE    h.run_status = 0 -- Failure  
         AND h.run_date > @FinalDate  
ORDER BY h.instance_id DESC
Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."

QuestionGETTING EXCEPTION ON JDBC TRANSACTION MGMT --->java.sql.SQLException: Invalid column index:at LINE 8 & 12 Pin
LOKENDRA YADAV10-Mar-17 21:13
LOKENDRA YADAV10-Mar-17 21:13 
QuestionRe: GETTING EXCEPTION ON JDBC TRANSACTION MGMT --->java.sql.SQLException: Invalid column index:at LINE 8 & 12 Pin
Richard MacCutchan10-Mar-17 21:55
mveRichard MacCutchan10-Mar-17 21:55 
AnswerRe: GETTING EXCEPTION ON JDBC TRANSACTION MGMT --->java.sql.SQLException: Invalid column index:at LINE 8 & 12 Pin
LOKENDRA YADAV10-Mar-17 21:58
LOKENDRA YADAV10-Mar-17 21:58 
AnswerRe: GETTING EXCEPTION ON JDBC TRANSACTION MGMT --->java.sql.SQLException: Invalid column index:at LINE 8 & 12 Pin
LOKENDRA YADAV10-Mar-17 22:05
LOKENDRA YADAV10-Mar-17 22:05 
GeneralRe: GETTING EXCEPTION ON JDBC TRANSACTION MGMT --->java.sql.SQLException: Invalid column index:at LINE 8 & 12 Pin
Richard MacCutchan10-Mar-17 22:27
mveRichard MacCutchan10-Mar-17 22:27 
QuestionAccess Application VS .Net Application Access Behind - How to Decide Pin
Member 1304435510-Mar-17 15:52
Member 1304435510-Mar-17 15:52 
AnswerRe: Access Application VS .Net Application Access Behind - How to Decide Pin
Mycroft Holmes11-Mar-17 13:05
professionalMycroft Holmes11-Mar-17 13:05 
GeneralRe: Access Application VS .Net Application Access Behind - How to Decide Pin
Member 1304435511-Mar-17 14:54
Member 1304435511-Mar-17 14:54 
GeneralRe: Access Application VS .Net Application Access Behind - How to Decide Pin
Mycroft Holmes12-Mar-17 14:31
professionalMycroft Holmes12-Mar-17 14:31 
QuestionFailed Steps of all Jobs and Disabled steps of all Jobs Pin
indian14310-Mar-17 6:30
indian14310-Mar-17 6:30 
AnswerRe: Failed Steps of all Jobs and Disabled steps of all Jobs Pin
ZurdoDev10-Mar-17 7:13
professionalZurdoDev10-Mar-17 7:13 
GeneralRe: Failed Steps of all Jobs and Disabled steps of all Jobs Pin
indian14327-Mar-17 11:04
indian14327-Mar-17 11:04 
Questioncomplilation error on stored procedure using sql??????????????? Pin
Member 130474308-Mar-17 19:48
Member 130474308-Mar-17 19:48 
QuestionRe: complilation error on stored procedure using sql??????????????? Pin
Richard MacCutchan8-Mar-17 21:24
mveRichard MacCutchan8-Mar-17 21:24 
Rant[REPOST] complilation error on stored procedure using sql??????????????? Pin
Richard Deeming9-Mar-17 1:20
mveRichard Deeming9-Mar-17 1:20 
AnswerRe: complilation error on stored procedure using sql??????????????? Pin
ZurdoDev9-Mar-17 2:02
professionalZurdoDev9-Mar-17 2:02 
AnswerRe: complilation error on stored procedure using sql??????????????? Pin
ZurdoDev9-Mar-17 9:47
professionalZurdoDev9-Mar-17 9:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.