Skip to content

Instantly share code, notes, and snippets.

@kulmam92
kulmam92 / GetLastNlinesfromLogFile.groovy
Last active May 9, 2016 18:37
Display last changed log file in the workspace of Jenkins build - parameter : workSpace -> $workspace
def myWorkdSpace = "$workSpace"
def files = buildFileList(myWorkdSpace)
def buildFileList(dirname) {
def files = [:]
def dir = new File(dirname)
if( dir.directory ) {
dir.listFiles().each {
def path = it.absolutePath
if( it.directory ) {
@kulmam92
kulmam92 / DB.Schema.SVNCheckin.bat
Created September 23, 2013 13:35
Check in DB schema to SVN using SQLCompare.
SVN add --username MyUser --password MyUserP@ss --force * --auto-props --parents --depth infinity
SVN commit --username MyUser --password MyUserP@ss -m "Daily Checkin"
#install SqlServer and TFS
cinst VisualStudioTeamFoundationServerExpress2013
cinst MsSqlServer2012ExpressWithReporting
#Configure SQL Reporting Services
$rsConfig = (Get-WmiObject `
-namespace "root\Microsoft\SqlServer\ReportServer\RS_MSSQLSERVER\v11\admin" `
-class "MSReportServer_ConfigurationSetting")
#Configuring Reporting Server Virtual Directories
CREATE PROC [dbo].[Job_FailaureMonitoring]
@HourInterval int = 24
,@recipients varchar(4000)
,@profile_name nvarchar(128)
,@debug bit = 0
AS
SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
BEGIN TRY
declare @body varchar(max)
@kulmam92
kulmam92 / EmailLastFailedStep_SendErrorMessage.sql
Last active August 29, 2015 14:03
How to get detailed error message of last step when job failed.
USE [msdb]
GO
CREATE PROC [dbo].[EmailLastFailedStep_SendErrorMessage]
@JobName nvarchar(128)
,@recipients varchar(4000)
,@profile_name nvarchar(128)
,@debug bit = 0
AS
SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED