Transact SQL – User defined error messages

Background

Quickly, how to identify user defined error messages.

Guide Post

Here is the Link :-

Docs / SQL / Relational databases / System stored procedures
sp_addmessage (Transact-SQL)
Link

@msgnum = ] msg_id
Is the ID of the message. msg_id is int with a default of NULL. msg_id for user-defined error messages can be an integer between 50,001 and 2,147,483,647.

Explanation

To defined a new error, we have to specify a message id greater than 50001.  Or pass along null, and an id greater than 50001 will be assigned to us.

Code

Outline

  1. sys.messages
    • messsage_id >=50001

SQL


select
          tblSM.[message_id]

        , tblSM.[language_id]

        , tblSM.[severity]

        , tblSM.[is_event_logged]

        , tblSM.[text]

        , [customized]
            = case
                when (tblSM.[message_id] >= 50001) then 'Y'
                else 'N'
               end	

from   sys.messages tblSM

where  tblSM.[message_id] >= 50001

Tom Krazit :- Why some open-source companies are considering a more closed approach

Background

There is a topic that I have been following in the last few months.

And, it is how well Cloud Service Providers are protecting the Open Source Ecosystem.

Writing for GeekWire, here is Tom Krazit update from  2018-Nov-19th.

 

Link

At the peak of its power, open-source software is having an existential crisis.

There’s no question that the concept of open-source software has revolutionized the enterprise software world, which spent billions of dollars fighting the mere idea for several years before accepting that a new future had arrived. But more than a few people are starting to wonder if the very nature of open-source software ― the idea that it can be used by pretty much anyone for pretty much anything ― is causing its developers big problems in the era of distributed cloud computing services.

Since we last explored this topic, two prominent open-source software companies have made the decision to alter the licenses under which some of their software is distributed, with the expressed intent of making it harder ― or impossible ― for cloud computing providers to offer a service based around that software.

Two companies does not a movement make. But as the cloud world packs its bags for Las Vegas and Amazon Web Services’ re:Invent 2018 conference next week, underscoring that company’s ability to set the agenda for the upcoming year, the intersection between open-source projects and cloud computing services is on many people’s minds.

“The way that I would think of it, the role that open source plays in creating commercial opportunities has changed,” said Abby Kearns, executive director of the open-source Cloud Foundry Foundation. “We’re going to see a lot more of this conversation happening than less.”

Changing of the guard

“I would put it in a very blunt way: for many years we were suckers, and let them take what we developed and make tons of money on this.”

Redis Labs CEO Ofer Bengal doesn’t mince words. His company, known for its open-source in-memory database, has been around for eight years, an eternity in the fast-changing world of modern enterprise software.

Cloud computing was very much underway in 2011, but it was still a tool for early adopters or startups that couldn’t afford to bet millions on servers to incubate a promising but unproven idea. Most established companies were still building their own tech infrastructure the old-fashioned way, but they were increasingly realizing that open-source software would allow them to build that infrastructure with open-source components in ways that were much more flexible and cheaper than proprietary packages from traditional enterprise software companies

AWS likes to insist that it is primarily focused on its customers, but that focus also allows it to see which technologies and services are gaining traction in order to offer similar services to its customers. It launched an AWS-managed version of the open-source version of Redis as a cloud service in 2013. Redis became quite popular during that period, and major companies like American Express, Home Depot, and Dreamworks built tech infrastructure using the database. Redis Labs offers its own product, Redis Enterprise, that provides the database as a service on public clouds or supports customers running it on their own infrastructure, and continues to contribute to the Redis open-source project.

Since then, AWS has made “hundreds of millions” of dollars offering Redis to its customers without contributing nearly as much to the open-source community that builds and maintain that project, Bengal said. It’s impossible to know exactly how much money we’re really talking about, but it’s certainly true that AWS and other cloud providers benefit from the work of open-source developers they do not employ.

“Ninety-nine percent of the contributions to Redis were made by Redis Labs,” Bengal said. There’s a longstanding myth in the open-source world that projects are driven by a community of contributors, but in reality, paid developers contribute the bulk of the code in most modern open-source projects, as Puppet founder Luke Kanies explained in our story earlier this year.

That money has to come from somewhere. For a long time, Redis was a good example of a successful open-source business model, shepherding the base project while developing its own software and services around it. But as more and more companies embrace cloud computing and “lift and shift” their existing applications and infrastructure to providers like AWS, it makes a lot of sense to use the AWS Redis service alongside all the other table-stakes AWS services like EC2 and S3 as opposed to a service offered by Redis through the AWS Marketplace.

“This is a problem not just for us but for almost any successful open-source project to date,” Bengal said. And while AWS is always the focus of these conversations due to its market power, it’s far from the only cloud provider around the world offering these types of open-source projects as services.

So in August, Redis Labs decided to convert the license it uses for new database extensions built on top of Redis — but not Redis itself — to the Commons Clause license, which specifies that other companies are not allowed to offer those extensions as a cloud service.

“We keep the freedom to decide for each piece of software whether to put that under the permissive open-source license or Commons Clause,” Bengal said. “This is basically a business decision.”

Then in October, another well-known open-source database company made a similar decision. MongoDB announced that going forward, it would license the MongoDB Community Server software under a different license called SSPL, which allows cloud providers to offer MongoDB as a service but requires them to either open-source all of the code they write to create that service or reach a commercial arrangement with MongoDB.

It’s not a coincidence that two database companies are leading this charge. Databases are extremely complicated projects to develop and absolutely vital to any enterprise company operating at scale.“Whenever a new open-source project becomes popular, cloud providers strip mine the technology, put the freeware on their platform, capture most if not all of the value but give little back to the community,” said Dev Ittycheria, president and CEO of MongoDB, currently valued at $4.3 billion on the Nasdaq. “We think it’s important for someone like us to lead and help the next set of open-source companies and projects thrive and grow.”

Ittycheria estimated that MongoDB had spent $150 million on research and development over the years to create and maintain the open-source version of the database. In its last fiscal year, MongoDB recorded $154.5 million from its commercial software and support services.

“Our view is that open-source software was never intended for cloud infrastructure companies to take and sell,” wrote Salil Deshpande, managing director of Bain Capital Ventures, in a post on Techcrunch after Redis announced its decision. Deshpande is an investor in Redis Labs and whose efforts to organize open-source companies and develop the Commons Clause license we previewed in March.

As open-source software became such an important part of the enterprise software world, it was probably inevitable that commercial interests would start to influence its direction more and more. The questions now are, what does it mean to be open source? And what do companies that generate revenue from offering services around open-source projects they did not develop owe to the creators and maintainers of those projects?

Open and shut

When considering the first question, it’s important to note that Redis’ Commons Clause license is decidedly not an open-source license, which everyone involved readily admits. Redis remains an open-source project under the widely used BSD license, but the company now applies the Commons Clause license to extensions it develops around that project.

With MongoDB, it’s a little different. Because the SSPL license stipulates that more open-source software should be the result when cloud providers offer an open-source project as a service, the company argues that this is consistent with the ethos of open source.

“Everyone wants more open source, but someone’s got to fund it. And to fund it you need to make sure you have a commercial existence,” Ittycheria said.

Adam Jacob, co-founder and CTO of Seattle’s Chef, which maintains a trio of open-source projects designed to make infrastructure and application management easier, was skeptical that this is the right direction for the future of open-source projects, developers, and companies.

“I don’t think it’s a community-based movement, for sure it’s not a movement in the way open source was a movement or that free software was a movement,” Jacob said. “It’s not like there’s a third-leg movement that’s like, ‘you know what we need is stronger commercial protections for businesses.’”
“The more interesting thing hiding inside here is that, from an open-source business model point of view, the open-source part of what they were doing was always a component of distribution for their business model. It was more about developer reach,” Jacob said, the primary goal being to create a “funnel strategy” that would draw in users with a free version and upsell them on the commercial version.After all, when they were getting off the ground and raising money companies like Redis and MongoDB were quite happy to take advantage of the friendly and open-minded nature of the open-source community to spread the word about their creations, he said.

Yet for a lot of small companies, participating in open-source communities and maintaining projects is the only way to compete against the more established players. One of the hardest things to do as a young unproven enterprise software company is to convince other companies they need to pay for your product.

“Open source offers a lot of opportunity, particularly for startup companies,” Kearns said. But at some point, that early strategic decision can become an albatross, she said; another really hard thing to do is to convince someone that what they once enjoyed for free now comes with a price.

Clouds on the horizon

This perhaps gets to the crux of the debate: is there still value in developing software out in the open as a community process that everyone can use, even if the days of the hobbyist open-source developer are long gone and cloud providers can take advantage of that work without having to contribute anything back?

Jacob thinks so.

“My belief is that what we have done wrong, we actually stopped trusting the commons and the value of free software as a necessity for building better communities because we decided very early on that the business and the community were two separate things,” he said.

Redis and MongoDB believe they aren’t throwing their open-source communities under the bus. They argue they have no choice but to find new ways to financially support the work of their developers, who are absolutely essential to the health of those communities, even if some of that work remains proprietary or comes with strings attached.

The big three cloud providers are keeping quiet on these issues for now, declining to make executives available to discuss this shift in open-source licensing. Google has evangelized the value of open-source since its earliest days, while Microsoft and AWS have taken different paths to this new world.

After years as Public Enemy #1, Microsoft has embraced open-source software, hiring developers with strong open-source experience and making some key contributions back to several communities. AWS has been slower to work closely with the open-source community, but has changed its tune over the last few years, bringing on open-source veterans like James Gosling and Adrian Cockcroft to shift its thinking about community contributions.

If more companies switch to this more aggressive style of licensing, it could force a shift in product-development strategies at cloud providers as they assess which services are worth striking commercial deals over, and which are not. For now, there are still lots of startups launching companies and projects around traditional open-source licenses, which means the industry is waiting to see how the market reacts to Redis and MongoDB’s moves.

But cloud computing has changed nearly all of the assumptions around how modern businesses should build and manage the technology they need to compete in the 21st century. It wouldn’t be too surprising if cloud computing changed some of the assumptions behind open-source software development.

Angel Tree – 2018 – Chapter 03

Background

It is Sunday and back in the House of worship.

In between services wanted to get in another chapter.

The Church

I recollect the words of William Temple sharing that the “The Church is the only institution that exists primarily for the benefit of those who are not its members.”

And, there is a lot of truth in that.

Angel Tree

There are many things Angel Tree share with other ministries.

Served

Yet, as a Prison Ministry it interconnects those shut in with their loved ones on the outside.

It allows them to recommit to their family in the following ways :-

  1. Grand Parents
    • As I have said before it is the Grandparents that are raising most of the children left behind
    • And, in some cases they improvise when the Angels ask about their parents.  They say they are away making money
    • Little Gifts in the names of the parents help further the stories and fable
    • And, in little ways the children will share something in common with their cousins and friends
  2. Present Parent
    • It is very hard being a Single Parent
    • And, they need a second affirming voice, as well

 

Administrators

The ministry Administrators includes the following :-

  1. Prison Clergy
  2. Volunteers who prepare the database of the shut-in and their Angels and assign that list to Churches

 

Churches

I am more familiar with the Churches and the part they play.

As often been said, it is the women of the Church who do most of the work.

Here is some of that work :-

  1. Desire to Listen
    • A desire to call the receiving family and ask about the children well being
    • Ask about their hurt and needs
    • Try to encapsulate those needs into concrete gifts
  2. Scoped Adoption
    • Their is sometimes a scoped adoption, as well
    • In some cases, these mothers look for children who share the same age with their children
    • In doing so they do for others as they do for theirs; and as they hope someone else will do for their children
    • With the children partnering, accosted to us is just not the person who picked an Angel, but a family line
  3. Abiding Prayer
    • When gifts are delivered it is hoped that the delivers will go in and fellowship with the receivers.
    • These days people are hesitant to go into other people homes.
    • And, so here we are with people wanting to participate, but they are not sure how deeply to step in and connect
    • Thus they sent others in
    • But, as community of faith, they they do not send them in with gifts
    • But, heavy in prayer with souls intertwined and spirits enjoined

 

Entrusted

As the second service started, the man who brought me into this ministry drove in with his wife.  He was sure to bring his wife unto the Church’s doorstep and waited on her to climb the stairs.

He handed her off to me as I held her hand and walked up those few stairs.

I grew up on the sister’s states to his.  They met at a military base on the next state over.

The quietness of the man.  The gentility of his spirit.

The hidden-ness that allows others to safely bring themselves up behind him.  And, understand that to serve there is need for brokenness and consecration.

Zophar’s Accusations & Job’s Answer

 

Videos

  1. Calvary South Denver in Littleton CO
    • Job 11:1-20, Zophar’s Accusations
      • Profile
      • We continue in our verse by verse teaching through the book of Job on Wednesday nights with Pastor Gino Geraci at Calvary South Denver in Littleton CO. This week we look at “Zophar’s Accusations” in Job 11:1-20.
        • The First Accusation: You Are Guilty of Sin (vv.1-4)
        • The Second Accusation: You Don’t Know God As Well As You Think (vv.5-12)
        • The Third Accusation: You Need To Repent And Put Away Sin (vv.13-20)
      • Videos
        • Video #1
          Channel :- Calvary South Denver
          Published On :- 2103-Dec-12th
          Link
    • Job 12:1-25, Job’s Answer To Zophar
      • Profile
        • We continue in our verse by verse teaching through the book of Job on Wednesday nights with Pastor Gino Geraci at Calvary South Denver in Littleton CO. This week we look at “Job’s Answer To Zophar” in Job 12:1-25.
          • The First Accusation: You Are Guilty of Sin (vv.1-4)
          • The Second Accusation: You Don’t Know God As Well As You Think (vv.5-12)
          • The Third Accusation: You Need To Repent And Put Away Sin (vv.13-20)
      • Videos
        • Video #1
          Channel :- Calvary South Denver
          Published On :- 2103-Dec-12th
          Link

 

In-depth

Job 12:1-25, Job’s Answer To Zophar

  1. Commentary
    • Matthew Henry
      • Though men are false, God is faithful
      • Psalm 12
        Link
  2. Those who are at ease have contempt for misfortune ( Job 12:5 NIV )
  3. Which of all these does not know
        that the hand of the Lord has done this?
    ( Job 12:9 NIV )
  4. Does not the ear test words
       ( Job 12:11 NIV )
  5. He leads counselors away plundered, And makes fools of the judges. ( Job 12:17 NKJV )
  6. He silences the lips of trusted advisers
        and takes away the discernment of elders.
     ( Job 12:20 NIV )
  7. He reveals the deep things of darkness
        and brings utter darkness into the light.
        ( Job 12:22 NIV )
  8. He deprives the leaders of the earth of their reason;
        ( Job 12:24 NIV )

Pastor Matt Chandler, The Village Church

Background

Pastor Matt Chandler delivers a set of teachings.

Videos

  1. RodiAgnusDei
    • Matt Chandler interviewed by John Piper
      Channel :- RodiAgnusDei
      Published :- 2015-Nov-15th
      Link
  2. The Village Church
    • The Gifts of The Holy Spirit
      Profile :- The Village Church exists to bring glory to God by making disciples through gospel-centered worship, gospel-centered community, gospel-centered service and gospel-centered multiplication.
      Channel :- The Village Church
      Published :- 2018-Nov-19th
      Link
    • The Wound and the Worry
      Profile :- The Village Church exists to bring glory to God by making disciples through gospel-centered worship, gospel-centered community, gospel-centered service and gospel-centered multiplication.
      Channel :- The Village Church
      Published :- 2018-Nov-19th
      Link

In-depth

Desiring God Conference

  1. Upbringing
    • Mum’s steadfast fate, but kept me in the house with this man
  2. Jeff Faircloth
    • Jeff Faircloth started to share the gospel with me
    • Got joy in my heart
      • Comical
    • For me
      • Guy wanted his dad to love him, but could not get there
    • Dad
      • Want to see my Dad Saved
      • What am I asking God to do if I am asking him to have my Dad Saved
  3. Faith
    • There are answers beyond asking for more faith
  4. Leo Smith
    • Leo Smith approached me about being a Youth Pastor
  5. Pressure of Western Evangelism
    • Be contextual

The Gifts of The Holy Spirit

  1. Verses
    • Isaiah 55:11
      • Verses
        • So shall my word be that goeth forth out of my mouth: it shall not return unto me void, but it shall accomplish that which I please, and it shall prosper in the thing whereto I sent it. [ Isaiah 55:11 King James Version (KJV) ]
      • Interpretation
        • The spirit of God does the work of God for the word of God
        • Good at talking
        • I can motivate you, but can not transform you
        • I can encourage you, but that does not make it out of the front room
    • 1 Thessalonians 5:19-22
      • Verses
        • Do not quench the Spirit.
          Do not treat prophecies with contempt but test them all; hold on to what is good, reject every kind of evil
      • Interpretation
        • Do not quench the Spirit
        • I wish I can pray like that, but I do want to be like that
        • In Abilene Texas, Billy Bob White approached me
          • He blew on me
          • Holy Ghost blow-age
          • God has asked me to blow on you
          • From that day for forward
          • Effectiveness of my ministry increased
          • Power of my preaching
          • Response to my preaching
          • Increases
          • Per this text
          • I can test it
          • The Spirit makes much of Jesus
  2.  Arrogance
    • Dr James Shields
      • I am twenty and I am arrogant, but don’t think I am
  3. You word leads into oneness
  4. Books
    • Sam Storm
    • Practicing the Power

The Wound and the Worry

  1. Verses
    • John 4
  2. Doctrine
    • Self defend with Doctrine
    • Relativism has leaked into The Church
  3. Brain Surgery Nine years ago
  4. Salvation is from the Jews
  5. Truth
    • God is a Spirit: and they that worship him must worship him in spirit and in truth.
  6. I am Statement
    • Jesus saith unto her, I that speak unto thee am he. ( John 4:26 )

Service Application via Visual Studio ( Day 1 )

Background

Let us lay out a lithe Service Application using Visual Studio Community Edition.

Visual Studio

Overview

  1. Install Visual Studio Community Edition
  2. Create New Project ( Windows Service )
  3. Installer Module
    • Add Installer Module
    • Customize Installer Module
  4. App.Config
    • Add Application Configuration Items
  5. Application
    • Configuration Items
      • Read Configuration Items
      • Log Configuration Items
  6. Install Service
  7. Configure Service
  8. Start Service

Download Install

Download & Install Visual Studio Community Edition if you don’t have it yet.

Usage

Create New Project – Service Application

Outline

  1. Create New Project
    • Visual C#
      • Windows Desktop
        • Type :- Windows Service (.Net Framework )

Image

newProject.20181130.0836AM.PNG

Add Installer

Outline

Link

  1. In Solution Explorer, access Design view for the service for which you want to add an installation component.

  2. Click the background of the designer to select the service itself, rather than any of its contents.
  3. With the designer in focus, right-click, and then click Add Installer.
    • A new class, ProjectInstaller, and two installation components, ServiceProcessInstaller and ServiceInstaller, are added to your project, and property values for the service are copied to the components.
  4. Click the ServiceInstaller component and verify that the value of the ServiceName property is set to the same value as the ServiceName property on the service itself.
  5. To determine how your service will be started, click the ServiceInstaller component and set the StartType property to the appropriate value.

Customize Installer

Outline

  1. serviceInstaller
    • Solution Explorer
      • Customize Service Installer Property Sheet
    •  constructor
      • InitializeComponent()
        • Make sure that you preserve the call to InitializeComponent
      • Customize Service
        • serviceName
        • displayName
        • description

Solution Explorer

Service Installer Property Sheet

Outline
  1. Access Solution Explorer
    • Access Item :- serviceInstaller.cs
      • Access Properties page
        • Adjust Service Properties
Image

serviceInstaller.20181130.0634PM.PNG

 

Code


using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.Threading.Tasks;

namespace journalBible
{
    [RunInstaller(true)]
    public partial class serviceJournalInstaller : System.Configuration.Install.Installer
    {

        static string appName = "journalBible";
        static string appDisplayName = "journal Bible";
        static string appDescription = "journal Bible Application ( Sample)";

        public serviceJournalInstaller()
        {

            InitializeComponent();

            this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;

            this.serviceInstaller1.ServiceName = appName;

            this.serviceInstaller1.DisplayName = appDisplayName;

            this.serviceInstaller1.Description = appDescription;

        }

        private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e)
        {

        }

        private void serviceProcessInstaller1_AfterInstall(object sender, InstallEventArgs e)
        {

        }
    }
}

Configuration

App.Config

Outline

  1. Add appSettings section
    • add Keys
      • smtpServer
      • emailAddress

Code

App.Config.20181130.0235PM

Main Code

Outline

  1. serviceInstaller
    • Methods
      • OnStart
        • Initialize
          • configurationRead
            • read configuration data from app.config file
          • configurationLog
            • write configuration data into Application Event Log

Code


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;

using System.Configuration;
using System.IO;
using System.Security;

namespace journalBible
{
    public partial class ServiceJournalBible : ServiceBase
    {

        static String strAppName;

        /*
         * Configuration App.Config - ID
        */
        static String ID_STMP_SERVER = "smtpServer";
        static String ID_EMAIL_ADDRESS = "emailAddress";

        /*
         * Configuration in App.Config - Variables
        */
        static String strSMTPServer;
        static String strEmailAddress;

        public ServiceJournalBible()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            initialize();
        }

        protected override void OnStop()
        {
        }

        protected void initialize()
        {

            try
            {

                configurationRead();

                configurationLog();

            }
            catch (Exception)
            {

            }

        }

        /*
         * Get Application Name
        */
        private String getAppName()
        {

            String strAppFriendlyName;
            String strAppName;

            strAppFriendlyName = AppDomain.CurrentDomain.FriendlyName;

            strAppName = Path.GetFileNameWithoutExtension(strAppFriendlyName);

            return (strAppName);

        }

        /*
         * https://docs.microsoft.com/en-us/dotnet/framework/windows-services/how-to-log-information-about-services
        */

        public System.Diagnostics.EventLog customLogging()
        {

            System.Diagnostics.EventLog objEventLog = new System.Diagnostics.EventLog();

            Boolean bEventLogSourceExist = false;

            // Turn off autologging
            this.AutoLog = false;

            strAppName = getAppName();

            // create an event source, specifying the name of a log that
            // does not currently exist to create a new, custom log
            bEventLogSourceExist = System.Diagnostics.EventLog.SourceExists(strAppName);

            if (bEventLogSourceExist == false)
            {
                System.Diagnostics.EventLog.CreateEventSource
                (
                      strAppName
                    , strAppName
                );

            }

            // configure the event log instance to use this source name
            objEventLog.Source = strAppName;

            //objEventLog.Log = strAppName;

            return (objEventLog);

        } //customLogging() 

        protected void configurationRead()
        {

            System.Collections.Specialized.NameValueCollection objAppSettings;

            objAppSettings = System.Configuration.ConfigurationManager.AppSettings;

            strSMTPServer = objAppSettings[ID_STMP_SERVER];

            strEmailAddress = objAppSettings[ID_EMAIL_ADDRESS];

        } //configurationRead()

        protected void configurationLog()
        {

            String strLog;

            EventLog objEventLog;

            objEventLog = customLogging();

            //Set Source Name
            //objEventLog.Source = strAppName;

            //Prepare Log Entry
            if (strSMTPServer != String.Empty)
            {
                strLog = ID_STMP_SERVER + " :- " + strSMTPServer;

                //Write Log Entry
                objEventLog.WriteEntry(strLog);
            }

            //Prepare Log Entry
            if (strEmailAddress != String.Empty)
            {

                strLog = ID_EMAIL_ADDRESS + " :- " + strEmailAddress;

                //Write Log Entry
                objEventLog.WriteEntry(strLog);

            }

        } //configurationLog()

    }
}

Install Service

Outline

  1. use InstallUtil.exe to install Service

Code

Syntax


C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe [exe-name]

Sample


setlocal

	set "_appInstallerFolder=C:\Windows\Microsoft.NET\Framework64\v4.0.30319"
	set "_appInstallerTargeted=InstallUtil.exe"

	set "_appInstaller=%_appInstallerFolder%\%_appInstallerTargeted%"

	set "_appTargetedFolder=bin\Release"
	set "_appTargetedModule=journalBible.exe"

	set "_appTargeted=%_appTargetedFolder%\%_appTargetedModule%"

	%_appInstaller% %_appTargeted%

endlocal

Source Control

GitHub

DanielAdeniji/svcjournalApp
Link

Referenced Work

  1. Microsoft
    1. Docs > .NET > .NET Framework > Developing Windows Service Applications
      • How to: Install and Uninstall Services
        Link
      • How to: Add Installers to Your Service Application
        Link

SQL Server On Linux / Ola Hallengren Scripts

Background

It is silly to install a database software and not have automated backup in place.

Let us address that.

Ola Hallengren

Outline

  1. Please download Ola Hallengren script
  2. Apply against SQL Server Instance

Processing

Download

Please download Ola Hallengren from here.

Apply

Please apply downloaded scripts against targeted SQL Server Instance.

Issues

Outline

  1. SQL Server Agent
    • Jobs
      • JobStep
        • Please change Step Type from “Operating System (CmdShell)” to “Transact SQL Script (T-SQL)
  2. Stored Procedure
    • dbo.DatabaseBackup
      • Parameters
        • @CleanupTime
          • Make sure it is not set

SQL Server Agent

Jobs

JobStep
Outline
  1. Job Step Type
    • In Linux, the lone Job Step type is “Transact SQL Script (T-SQL)
  2. Change Step from Command Shell verbiage to SQL
    • Backup
      • Verbiage
        • OS
          • sqlcmd -E -S $(ESCAPE_SQUOTE(SRVR)) -d AdminDB -Q “EXECUTE [dbo].[DatabaseBackup] @Databases = ‘SYSTEM_DATABASES’, @BackupType = ‘FULL’, @Verify = ‘Y’, @CleanupTime = 72, @CheckSum = ‘Y’, @LogToTable = ‘Y'” -b
        • SQL
          • EXECUTE AdminDB.[dbo].[DatabaseBackup] @Databases = ‘SYSTEM_DATABASES’, @Directory = NULL, @BackupType = ‘FULL’, @Verify = ‘Y’, @CheckSum = ‘Y’, @LogToTable = ‘Y’
Images
Before

SQLServerAgent.step.01.before.20181128.1215PM.PNG

After

SQLServerAgent.step.01.after.20181128.1219PM.PNG

Parameters

CleanupTime

Finding

When cleanupTime is specified SQL Server utilizes [master].dbo.xp_delete_file to remove dated files.

While sanitizing its input, xp_delete_file returns

Msg 22049, Level 15, State 0, Line 0
Error executing extended stored procedure: Invalid Parameter
Msg 50000, Level 16, State 1, Line 1
Error deleting files.

It appears that because the Linux File System uses / and MS Windows uses \ , the system barks.

Workaround

Please skip Timestamp for filename


@FileName nvarchar(max) = '{ServerName}${InstanceName}_{DatabaseName}_{BackupType}_{Partial}_{CopyOnly}_{Year}{Month}{Day}_{Hour}{Minute}{Second}_{FileNumber}.{FileExtension}'

 


@FileName nvarchar(max) = '{ServerName}${InstanceName}_{DatabaseName}_{BackupType}_{FileNumber}.{FileExtension}'

Cross Reference
  1. Microsoft
    • feedback.azure.com
      • xp_delete_file on SQL Server 2017/Linux
        Link
  2. Ola Hallengren
    • ola hallengren/sql-server-maintenance-solution
      • DatabaseBackup
        Link