SQL Server – Database – File Growth

Background

Checking file growth settings and patterns is always good to determine if basic best practices are being followed.

Code


select 

		  [database]	
			= tblSD.[name]

		, [datafileSymbol] 
			= tblMF.[name]

		, [datafileSymbol] 
			= tblMF.[physical_name]

		, [fileID]	
			= tblMF.[file_id]

		, [fileType]
			= tblMF.[type_desc]

		, [isPercentGrowth] 
			= case
				when tblMF.[is_percent_growth] = 1 then 'Yes'
				else 'No'
			  end

		, [growth]
			= CASE tblMF.is_percent_growth 
					WHEN 1 THEN CONVERT(VARCHAR(10),tblMF.growth) +'%' 
					ELSE Convert(VARCHAR(10), tblMF.growth*8/1024) + ' MB' 
			  END


from   sys.databases tblSD

inner join  sys.master_files tblMF

	on tblSD.[database_id] = tblMF.database_id

order by

		cast
		(
			case 
				when tblSD.[name] in ('master', 'model', 'msdb', 'tempdb', 'tempdb') 
						then cast( tblSD.[database_id] as sysname)
						
				else tblSD.[name]
			end
				as sysname
		)
		, tblMF.[name]
	


Shaykh Hamza Yusuf

Intro

Met another young lady via public transit.

She was reading via her Amazon Kindle.

And, upon asking what she is reading she responded Koran.

I asked for other accessible voices and offered Shaykh Hamza Yusuf.

In the days and weeks ahead, I will share some of the videos I have taken in from him.

Videos

  1. A Life Worth Living – Shaykh Hamza Yusuf
    • What is a life worth living? Shaykh Hamza presents, and discusses the question with Miroslav Volf, Professor of Theology at Yale Divinity School.
      Link
  2. Dr Hamza Yusuf The poor to the rich mind 2016
    • Published on August 17th, 2016
      Link
  3. Many Lessons from the story of Adam – Shaykh Hamza Yusuf
    • Published on August 25th, 2016
    • Link

Indepth

A Life Worth Living – Shaykh Hamza Yusuf

  1. 50 years ago, Time came out with a question asking whether God is dead
    • Atheist take a position that God is too great and it is impossible to believe in him
  2. We taught Allah the names
    1. Adam replied with the names
    2. And, God confirmed that yes, this is a learning creature
  3. Go down to the earth
    • Go down to the earth, and knowledge will come
    • Whomever follows that guidance will be well
  4. Breaking the desires
    • Breaking the desire of lust and food
    • Control desire for corruption
  5. Franz Rosenthal
    • Quotes
      • Know of no longer civilization that places the acquisition of knowledge at the center of ethos
    •  Books
      • Knowledge Triumphant: The Concept of Knowledge in Medieval Islam 1970 (reprinted 2007 with a Preface by Dimitri Gutas)
  6. Knowledge
    • Read in the name of your Lord
    • Be a student, be a lover of Knowledge
    • If one can not be a student, then help and facilitate it
    • Family Traits & Dedication
      • Every Irish family, gave at least one of their children to priesthood
      • Every muslim family gave at least one of their children to Islamic Scholarship
  7. Non Scholars can participate, as well
    • In Example
      • A bedouin in West Africa
        • Whoever believes in Allah in the last days should honor his guests
  8. Two people
    • Learners
      • Some people are facilitated to learn
      • The circumstances are right for it
    • Whereas some are not
      • Other people are deprived
      • Those that have the gift should actively seek to spread it
      • Honor for sake of our tradition and of our God
  9. Signs of the latter days
    • People will no longer learn for the sake of Allah, but for other ends
  10. Sign of depravity
    • It is a sign of the improvised state of our community that people like me actually represent …
    • Do not say so humbly, but based on knowledge of our tradition
  11. Why people choose not to believe
    • Those who see knowledge
      • But, yet fail to ascribe source to it
      • Sees a beautiful written letter, yet state their is no writer
  12. Empathy
    • Empathy is core of most religions
    • Social-path
      • So important that some people fake it just to be seen has having it
        • Just to be part of quorum
      • 1 out of 20 in US are suspected to be social-path
    • lack compassion from our own adversity
    • Some people
    • To know God through secondary knowledge
      • Not as Angels
      • But, through difficulty the soul is expanded
  13. Fundamental Sin
    • Distraction
      • Easily distracted
      • Boredom
      • NoonDay Devil
      • Spiritual Sickness
      • Seek distraction through Sex, Money, Pursuit of Money
  14. Atheist
    • Koran states to the Atheist let us weigh it out
    • God is too mighty to create all this
    • Unrequited Love
  15. Questioned about Job
    • My servant, Job, has spoken rightly of me
      • Job insisted that he was not not in the wrong
      • But, is it possible that someone spoke the truth, and yet still be wrong
        • One can speak personal truth
        • But, yet not speak God’s truth
  16. Is suffering a wound that will remain until clarity comes
  17. Abrahamic tradition did not fully develop the concept of Karma
    • It speaks of it in a world to come
  18. Where is God
    • Free will is a packaged deal
      • We are caretakers of the children
      • Where are God’s people
      • We have moral responsibility
  19. Atheist is closer to God
  20. For Believers God sometimes becomes an errand boy
  21. Taking Responsibility
    • Adam took responsibility
    • Satan did not take responsibility
  22. Current TV
    • Lamented that we have lost the pleasure derived from real beauty
    • Father is an erudite
    • Visited Sea World
      • No longer nature based
      • Stupid dresses on animal
      • Whereas animals are by nature dignified
  23. Knowledge & Submission to God
    • Knowledge
      • One has to know self
      • Soul
        • Indivisible
      • He who know himself comes his creator
      • He who knows self know God
      • From your tongues and complexities ( complexion )
        • Language is a celestial thing
        • Part of revelation is worth
        • God taught him from the names of all the animals
        • See the one in the many
        • From the knowledge of all, comes knowledge of one
    • Submission
      • Abdullah

Dr Hamza Yusuf  – The poor to the rich mind 2016

  1. A re-emergence of family has the center
    • Father has been taking out of fatherhood
    • Father has been taking of motherhood
    • Brother out of bortherhood
    • Sister out of sisterhoo
    • And,  all you have left is the hood
  2. Chris Hedges
    • Boook – Empire of Illusion
    • Dissolve the Police Force in Camden
    • Throwaway people
  3. The immigrant population has a moral responsibility they have not accepted.  And,  that responsibility is to adopt the indigenous people.
    • A ethical and strategic mistake
    • Clip – 30 minutes
    • Inner City
    • Giving victory by the weakest among you
    • Dignify poverty
    • Protestantism at his worst
      • Matthew 19:21
  4. The lion has a natural limit
    • He will not eat the whole flock

SQL Server – Developer Edition on MS Windows 7

Background

Have a new machine that is running MS Windows 7.

Need SQL Server Client tools on it.  But, would really rather have a server footprint, as well.

 

Considerations

Thought of installing SQL Server Express or Advanced Express Edition, but found out that the Developer Edition is now free.

Based on this blog post, starting on March 31st, 201, Developer Editions will be free going forward.

 

Versions

SQL Server 2016 Developer edition

The 2016 edition is available here.

But, it is not install-able on a MS Windows 7 machine.

 

SQL Server 2014 Developer edition

And, so sought out the previous edition, which happens to be v2014.

Download Links

The link for the download media is:

  1. SQL Server 2014 Developer ( on MyVisualStudio.com )
    Link

 

Offerings

One is able to download the Release To Manufacturing ( RTM ) or Service Pack 1/ Service Pack 2 Slip-streamed.

Product Date Link
SQL Server 2014 Developer Edition with Service Pack 2 7/13/2016 Link
SQL Server 2014 Developer Edition with Service Pack 1 5/21/2015 Link
SQL Server Developer Edition 4/1/2014 Link

 

 

Choice

Chose to go with v2014/SP2, as there is no reason to go through the headache of installing the RTM and having to manually update myself.

Or having it updated via Corporate patch system.

 

 

NY Times – LANDON THOMAS Jr. – Greek Crisis, the Book. Or Actually Several of Them

Background

Back in early August 2016, I read an article in the New York Times Business section.

It spoke about the many books that are out that renders a voice to the various participants in the Greek bailouts.

Yesterday, I ran into a lady who was on her away to visit Greece.  And, somehow coincidentally I came across the same cluster of newspapers today.

And, so it must be time to share the article.

 

Greek Crisis, the Book. Or Actually Several of Them

Link
In May last year, James K. Galbraith, a left-leaning American economist, sent an email to Greece’s finance minister, Yanis Varoufakis, in which he argued that an exit from the eurozone would benefit Greece.

Mr. Galbraith, who was advising Mr. Varoufakis at the time, made the case that a new currency would wash away the country’s debts, solve Greece’s competitiveness problem and ultimately create what he called a “good society.” Though the step was opposed by most Greeks, he had drawn up a contingency plan for Greece under Mr. Varoufakis’s direction, in the event the country was forced to leave the currency zone by its creditors.

In the end, there was not a so-called Grexit. One year ago this month, after the polarizing finance minister left his post, Greece agreed to its third bailout with Europe, accepting yet another round of brutal austerity measures as the price for a new round of loans.

Mr. Galbraith’s vision of a sun-kissed utopia of powerful unions, small businesses and cultural exchanges was published in June in his book of essays, speeches and assorted memorandums (“Welcome to the Poisoned Chalice”; Yale University Press) describing the five months he spent as an unofficial member of Mr. Varoufakis’s inner policy circle.

A starry-eyed embrace of all that Mr. Varoufakis said and did, the book also highlights the extent to which unorthodox, if not unrealistic, economic thinking reached the highest levels of the Greek government as it battled with its creditors last summer.

As the anniversary of Greece’s bailout deal approaches, there have been several memoirs, essays, a blistering critique of the International Monetary Fund’s policies in Europe and even a book of poetry that, from various perspectives, examine Greece’s torturous struggle to avoid bankruptcy.

The history of Greece in the eurozone is by no means complete, and the latest financial rescue package is still being worked out. But the accounts do offer up a number of piquant revelations on that nation’s crisis, including outright policy mistakes, dubious conduct, personal agendas and tragedies.

And as the negotiations between Greece and its creditors slowly press on, these works serve as a reminder that an agreement allowing Greece to pay off its debts without strangling its economy is unlikely to be reached any time soon.

“There is a fog-of-war atmosphere here that inhibits good policy making,” said Paul Blustein, a former Washington Post reporter and the author of “Laid Low: Inside the Crisis that Overwhelmed Europe and the I.M.F.,” which will be out in October. “But there are no villains — just people fighting their corner and kicking the can down the road.”

Besides Mr. Galbraith’s work, Mr. Varoufakis and George Papaconstantinou, the finance minister during the saga’s early days, have come out with books. Nick Papandreou, the brother of former prime minister George Papandreou, has written a searing personal essay about the Greek press attacking his family. And a collection of poems, “Austerity Measures,” examines the crisis.

Without question though, the most comprehensive examination has been a series of papers put out as a report by the International Monetary Fund’s internal watchdog — the Independent Evaluation Office.

The report reveals how I.M.F. staff members operated outside official channels, kept sensitive papers in personal files, withheld crucial documents from the watchdog agency and did not keep the fund’s board fully informed during the crisis.

The secrecy was such, I.M.F. board members said, that at times they learned more of what was going on in Greece from media reports than their own staff.

The I.M.F. has a mandate to serve as an objective lender of last resort to troubled economies. The report by the watchdog agency, which also examines the crises in Ireland and Portugal, highlights just how difficult it was for the fund to fulfill its mission in developed Europe as opposed to the emerging world where it usually operates.

I.M.F. economists did not foresee the crisis in Europe — from bank blowups in Spain and Ireland to sovereign bankruptcy in Greece — because of “groupthink and intellectual capture,” the report said.

The I.M.F., after all, has always been run by a European, and many of its top executives, hailing from Italy, Spain, France and Portugal, had complete trust in the sanctity and strength of the euro.

It was not until mid-2010, the watchdog points out, when the Greek crisis was in full swing, that I.M.F. economists first accepted that excessive borrowing by smaller countries using the euro — Greece and Ireland — could have a destabilizing effect on the currency zone.

Time and again, the review highlights this unwillingness of the fund to challenge European officials as a persistent flaw in its policies, leading to its highly controversial decision to lend money to Greece in 2010, even though economists at the fund believed that the near-bankrupt country had little chance of paying the money back.

In blunt language, Susan Schadler, a former top official at the I.M.F., writes that the I.M.F. was too easily swayed by European officials who argued that not lending to Greece, or requiring it to restructure its debt, would create a systemic panic in the markets.

In a response to the watchdog agency’s report, Christine Lagarde, the managing director of I.M.F., called the fund’s involvement in Europe a qualified success. She said Greece’s problems were unique and that the bottom line was that the country had remained in the euro.

But Ms. Schadler has a different view, seeing the decision and the secretive way it was handled as damaging to the fund’s reputation.

“By not following an open, transparent process, the fund created the perception that a decision made in Europe had been imposed on it,” she wrote in her paper.

A self-published memoir by George Papaconstantinou, the Greek finance minister at the time, looks at why the I.M.F. had to lend to Greece in the first place in 2010.

Mr. Papaconstantinou bills his chronicle (“Game Over: The Inside Story of the Greek Crisis”) as a political thriller, and for those interested in who was saying what to whom as Greece fell apart, his account is a valuable one.

One tends to forget just how absurd Greek finances were when he took over.

One example: The Greek Finance Ministry spent 35,000 euros a month on buying newspapers alone.

And there are some juicy vignettes, such as a warning from Jean-Claude Trichet, then the head of the European Central Bank, that a restructuring of Greek debt would have the same effect on global markets as allowing Lehman Brothers to fail.

Mr. Papaconstantinou also relates how he came to be seen as a scapegoat for Greece’s ills. He was personally blamed for the austerity measures and brought to trial on what turned out to be spurious charges relating to how he handled sensitive files about Greek taxpayers.

Mr. Papandreou’s essay, “Taming the Dogs of War,” which he presented in April at a conference on media pressures from business and government, covers some similar ground.

He recounts how the newspapers in Greece, which are controlled by powerful businessmen, attacked him as well as his brother, the former prime minister, accusing him of hoarding money overseas and driving him to the brink of suicide.

Mr. Varoufakis also has a book out, which asks: “And The Weak Suffer What They Must?”

For the many who are waiting for his promised tell-all about his experiences battling with European and I.M.F. officials over Greece’s debt, this is not that book.

Fans of Mr. Varoufakis will lap up his fiery criticisms of European and American economic policy making, but other readers will prefer to wait until next summer when his blow-by-blow account is scheduled to be published.

Videos

Yanis Varoufakis

  1. Universal Basic Income Will Be Required Because of Automation Yanis Varoufakis
    Link

 

Quotes

Yanis Varoufakis

  1. Basic Income
    • Basic Income is a necessity
      • It is a necessity
      • Civilized Capitalism
    • Stabilize Capitalism
    • Twenty Century
      • New Deal in US
      • Social Democratic in Europe
      • New deal is finished and can not be revived
      • Redistribution of wage within the economy
    • What is the new deal?
      • Redistribution of wages within the working class
        • National Insurance in Britain
        • Unemployment Insurance in the US
      • Health Provision
      • Pension
      • Minimal wages
      • Trade Unions
      • Taxation
  2. It is now dead
    • Reasons?
      • Financialization
        • Process of financialization
        • Created wedge between capital and labor
        • New Labor, New Capital
        • Socialization
          • 1991 Died with Soviet Union
        • Capitalization
        • 2008 died
        • High Deflation
          • Negative interest rates territory
        • 1929
          • Gold standard died
        • Working class can not insure itself
        • Young can not get jobs
        • Wage has stagnated that it is impossible for
      • Toxic Political Climate
        • EU
          • Brexit
        • Washington
          • White House & Congress
        • Political Governance
        • Ungovernable
      • Rise of the machines – Artificial Intelligence
        • What will go away …
          • Repetitive & Routine work
          • Algorithm work
        • What machines pass the tuning effect
        • Overwhelm creation effect
          • More job distraction than job creation
        • Manufacturing work was replaced by low wage repetitive work
          • In the last 30 years
    • Implications
      • Reinforce inflationary pressure that keeps Central Bankers awaking at night
      • Accelerate downsizing of Aggregate demand
      • Significant displacement between Savings & Investment
      • Even lower the current savings rate which is already very and too low
  3. Likely Remedies
    • Basic Income
      • The struggle we are going to have is in an ethical one
      • A struggle of the Heart to carry hearts and minds
      • Opposition from all sides
        • From the Haves and the Have Nots
        • From the left, the social democrats, from leftist
        • Sense of dignity to get something for nothing
      • To give money to the un-deserved
    • Current narrative of Capitalism
      • Private production of wealth is later appropriated by State for social services
    • In practice, narrative of Capitalism
      • But, this is what often occurs in the real world
      • If one takes time to break apart any new machine, one quickly sees parts that came to be through Government grants
      • Our wealth production is more communal

SQL Server – Messages – Backup

Background

Reviewing SQL Server Agent jobs and came upon some messages that I wanted to be sure do not pose any risk.

 

SQL Server Agent

Backup Jobs

backupdatabaselogbrushed-up

 

Messages

The specific messages that we will be digging more into are:

  1. 3014
  2. 3211

 

What do the messages mean?

Code


set nocount on;

declare @language		   sysname
declare @languageID		   int	

declare @languageIDDefault int
declare @languageIDEnglish int

declare @sqlMessageID_3014 int
declare @sqlMessageID_3211 int

set @sqlMessageID_3014 = 3014
set @sqlMessageID_3211 = 3211

set @languageIDDefault = 0 
set @languageIDEnglish = 1033

set @language        = @@language

/*
	Message
		Executed as user: LABDOMAIN\sqlAgent. ...rcent processed. [SQLSTATE 01000] (Message 3211)  
		19 percent processed. [SQLSTATE 01000...  The step succeeded.
*/
if (@language is not null)
begin

	select @languageID	= tblSL.[langid]
	from   sys.syslanguages tbLSL
	where  tblSL.[name] = @language

end

if (
		(@languageID is null)
	)
begin

	set @languageID = @languageIDDefault

end

print 'Default Language ' + isNull(@language, '')
print 'Language ID ' + cast(isNull(@languageID, -1) as sysname)

select top 100 *
from   sys.messages tbLSM
where  (
			   (tblSM.language_id = @languageID)
			or (tblSM.language_id = @languageIDEnglish)
	   )		
and    tblSM.message_id	in
		 (
			  @sqlMessageID_3014		
			, @sqlMessageID_3211
		 )


 

Explanation

What we did is query the master.sys.messages table

We filtered on

  1. The messages ID
    • 3014
    • 3211
  2. And, passed along the language ID

 

Output

output-grid

 

Explanation

Message ID Severity  Interpretation
 3014 10  At the completion of backups, we are told how many pages were backed, how long it took, and throughput
 3211  10  When the stats option is passed, backup and restore commands render percentile status message on the progress

 

BTW, Severity 10 is an informational message as demonstrated here.

Database Engine Error Severities

levelsofseverity

 

Summary

If bothered by the 3211 message please remove the stats operand from the backup command.

Using the 3014 message, backup completions are logged to both the console and SQL Server’s errorlog.

Please enable the 3605 Trace Flag to suspend logging of backup completion to the errorlog.

It is not clear if one is able to dissuade logging to the console.

SQL Server – SQL Server Agent – Job Status

Background

Quickly trying to get status of our SQL Server Agent Jobs.

Script

dbo.sp_listSQLServerAgentJobStatus

Stored Procedure


use master
go

if object_id('dbo.sp_listSQLServerAgentJobStatus') is null
begin


	exec('create procedure dbo.sp_listSQLServerAgentJobStatus as ')
end
go

alter procedure [dbo].[sp_listSQLServerAgentJobStatus]
(
	   @jobCategory    sysname = null
	,  @jobSubCategory sysname = null
	,  @jobName		   sysname = null	
) 
as
begin
		
	set nocount on;
	SET XACT_ABORT ON;
	set transaction isolation level read uncommitted;
  
	 declare @tblJobAggr TABLE
	 (
		  [id]				int not null identity(1,1)
  		, [job_id]			uniqueidentifier  not null
		, [step_id]			int not null
		, [instance_id]		int not null

		, primary key
  			(
				  [job_id]
				, [step_id]
			)
	 )

	declare @tblJobStep TABLE
	(
		   [id]        int not null identity(1,1)
		,  [stepname]  sysname
		,  [primary]   bit
		,  [secondary] bit
	 )

	 declare @CHAR_WILDCARD		     char(1)

	 declare @jobCategoryLogShipping sysname

	 declare @jobSubCategoryWildcard sysname

	 declare @jobNameWildcard		 sysname

	 declare @tblResult TABLE
	 (

		  [id] int not null identity(1,1)

		, [sqlInstance] sysname null

		, [JobName]		sysname not null

		, [Category]	sysname not null

		, [stepID]		int    not null

		, [StepName]	varchar(4000) not null

		, [runStatus]	varchar(4000) null

		, [runStart]			datetime    null

		, [runDurationAsHHMMSS] varchar(4000) null

		, [sqlMessageID]	    varchar(4000) null	

		, [sqlSeverity]		    int	

		, [message]				varchar(8000) null

		, [outputFileName]		varchar(8000) null

	)

	set @CHAR_WILDCARD = '%'

	set @jobCategoryLogShipping = 'Log Shipping'

	 if (@jobSubCategory is not null)
	 begin

		 set @jobSubCategoryWildcard = 
				@CHAR_WILDCARD 
					+ @jobSubCategory 
					+ @CHAR_WILDCARD

	end

	if (@jobName is not null)
	begin

		set @jobNameWildcard = 
					  @CHAR_WILDCARD
					+ @jobName 
					+ @CHAR_WILDCARD

	end
						
	insert into @tblJobStep
	(
		   [stepname]
		,  [primary] 
		,  [secondary]
	)
	select 
		  'Log shipping backup log job step.'
		, 1
		, 0
	union
	select 
		  'Log shipping copy job step.'
		, 0
		, 1
	union
	select 
		  'Log shipping restore log job step.'
		, 0
		, 1


	 ; with cteInstance
	 (
 		  [job_id]
		, [step_id]
		, [instance_id]
	)
	 as
	 (
 		SELECT 
				  job_id
					= DBSysJobHistory.job_id

				, [step_id]
					= DBSysJobHistory.step_id

				, [instance_id]
					= MAX(DBSysJobHistory.instance_id) --as instance_id

		FROM msdb.dbo.sysjobhistory DBSysJobHistory

		GROUP BY
				  DBSysJobHistory.job_id
				, DBSysJobHistory.step_id
	)
	insert into @tblJobAggr
	select *
	from   cteInstance

	 /*
		http://stackoverflow.com/questions/10577676/how-to-obtain-failed-jobs-from-sql-server-agent-through-script
	 */
 
	insert into @tblResult
	 (

		  [sqlInstance]
		, [JobName]		
		, [Category]	
		, [stepID]		
		, [StepName]
		, [runStatus]
		, [runStart]		
		, [runDurationAsHHMMSS] 
		, [sqlMessageID]	
		, [sqlSeverity]		
		, [message]				
		, [outputFileName]

	)

	 SELECT  

			 [sqlInstance]
				=  DBSysJobHistory.[server]

			, [JobName]
				= SysJobs.[name]

			, [Category]
				=SYSJOBCAT.[name]

			, [stepID]
				= DBSysJobHistory.step_id

			, [StepName]
				= SysJobSteps.step_name

			/*
			, [runStatusID]
				= DBSysJobHistory.run_status
			*/

			, [runStatus]
				= case
						when DBSysJobHistory.run_status = 0 then 'Failed'
						when DBSysJobHistory.run_status = 1 then 'Succeeded'
						when DBSysJobHistory.run_status = 2 then 'Retry'
						when DBSysJobHistory.run_status = 3 then 'Canceled'
						else 'Indeterminate'
				  end

			--,DBSysJobHistory.run_date

			--,DBSysJobHistory.run_time

			,[runStart]
					=
						convert
						(
							  varchar(30)
							, [msdb].dbo.agent_datetime
								( 
									  DBSysJobHistory.run_date
									, DBSysJobHistory.run_time
								)
							, 101

						)

			,[runDurationAsHHMMSS]
				= DBSysJobHistory.run_duration

			, [sqlMessageID]
				= DBSysJobHistory.sql_message_id

			,[sqlSeverity]
			   = DBSysJobHistory.sql_severity

			,[message]
				= DBSysJobHistory.[message]

			,[outputFileName]
				= SysJobSteps.output_file_name

		FROM msdb.dbo.sysjobhistory DBSysJobHistory

		JOIN msdb.dbo.sysjobs SysJobs
		   ON (DBSysJobHistory.job_id = SysJobs.job_id)

		JOIN msdb.dbo.sysjobsteps SysJobSteps
		   ON (
					( DBSysJobHistory.job_id = SysJobSteps.job_id )
				AND ( DBSysJobHistory.step_id = SysJobSteps.step_id )
			  )

		LEFT OUTER JOIN msdb.dbo.syscategories SYSJOBCAT
			ON SysJobs.category_id = SYSJOBCAT.category_id

		INNER JOIN @tblJobAggr  AS Instance 
			ON DBSysJobHistory.instance_id = Instance.instance_id

		/*
			If Category filtering is enabled
		*/
		if ( @jobCategory is not null)
		begin

			delete
			from  @tblResult
			where ( [Category] != @jobCategory )

		end

		/*
			If Sub Category filtering is enabled
		*/
		if ( @jobSubCategory is not null)
		begin

			delete
			from  @tblResult
			where ( [stepName] not like @jobSubCategoryWildcard )

		end

		/*
			If Sub Category filtering is enabled
		*/
		if ( @jobName is not null)
		begin

			delete
			from  @tblResult
			where ( [jobName] not like @jobNameWildcard )

		end

		select 
			  [RowNumber]
				= ROW_NUMBER() 
						OVER
						(	
							ORDER BY
									   [SQLInstance]
									,  [JobName]
									,  StepID
						)

			, [sqlInstance]
			, [JobName]		
			, [Category]	
			, [stepID]		
			, [StepName]
			, [runStatus]
			, [runStart]		
			, [runDurationAsHHMMSS] 
			, [sqlMessageID]	
			, [sqlSeverity]		
			, [message]				
			, [outputFileName]

		from   @tblResult

		Order by
				   [SQLInstance]
				,  [JobName]
				,  StepID
		
end
go

exec sys.sp_MS_marksystemobject '[dbo].[sp_listSQLServerAgentJobStatus]'
go

grant execute on [dbo].[sp_listSQLServerAgentJobStatus] to [public]
go



Sample

Sample – Log Shipping

Code

use master
go

declare @jobCategory sysname
declare @primary     bit

set @jobCategory = 'Log Shipping'
set @primary     = null

exec [dbo].[sp_listSQLServerAgentJobStatus] 
      @jobCategory = @jobCategory
	, @primary     = @primary

Output

logshipping-20160923-1256pm

 

Source Control

GitHub

Here is the URL for the file

Link

Sermons & Discussions – 2016/Oct

 

Sermons

  1. The Bridge Church, Concord, CA
    • Russ Belmont
      • The Love of Jesus and the Gospel / About Us
        Published On – Sept 18th, 2016
        Link
  2. John Piper
    • John Piper | Desiring God 2014 Conference for Pastors
      • Glorifying God by Bearing Fruit in Union with Christ
        Link
  3. Jacob Prasch
    • Titus
      • Titus Chapter 1 – From the Greek – Part 1 of 2 – Jacob Prasch
        Link
      • Titus Chapter 1 – From the Greek – Part 1 of 2 – Jacob Prasch
        Link
    • “This Generation” Matthew 24
      • “This Generation” Matthew 24 – Jacob Prasch
        Published On – Aug 16th, 2016
        Link
    • Health, Wealth and Education – 1 Corinthians and 3 John
      • Health, Wealth and Education – 1 Corinthians and 3 John – Jacob Prasch
        Link
  4. Sinclair Ferguson
    • Sinclair Ferguson | Desiring God 2014 Conference for Pastors
      • Union with Christ: Mind-Renewing Foundations
        Link

 

Discussions

  1. Nicole C. Mullen & Sandi Patty
    • Nicole C. Mullen & Sandi Patty – Matters Of Love
      Published on Aug 17, 2016
      Matters of Love … Music, Mentorship and Race: A Conversation with Andrew Greer featuring SANDI PATTY and NICOLE C. MULLEN.
      Link