Function to Split a Delimited String into a Table

This function splits a delimited string (up to 4000 characters long) into a single column table. The delimiter can be specified at the time of execution. If not specified, the delimiter defaults to a comma. The default length of each value is 100, but that can easily be changed.An example for usage:DECLARE @string NVARCHAR(4000)DECLARE @instruments […]

3.17 (6)

2007-05-25 (first published: )

5,308 reads

Backup any/all Databases (Native AND LiteSpeed friendly)

This script can run backups for any/all databases using both SQL native and Quest's SQL LiteSpeed product. It includes options for Complete (Full), Differential, and Transaction Log backups (File and File Group backups will be coming soon). It will also clean up old backups and the msdb tables accordingly.See script for a full parameter list.NOTE: […]

5 (3)

2006-10-25 (first published: )

5,114 reads

Function to return the SQL Build Number

This function returns the SQL Build Number as a nvarchar(20) string. i.e. '8.00.760' @@Version is great, but super long, and the formatting of the string has changed over the years. This helps me find out what build of SQL I'm working on in a quick and efficient manner. The script includes the drop statement as […]

5 (1)

2006-08-09 (first published: )

978 reads

Function to return the SQL Version Number

This function returns the SQL Build Number as an int. i.e. 7, 8, or 9. @@Version is great, but super long, and the formatting of the string has changed over the years. This helps me find out what version of SQL I'm working on in a quick and efficient manner. The script includes the drop […]

2006-08-08 (first published: )

1,207 reads

Stored Procedure to get Job History (with Steps)

This procedure returns the job history for any jobs run on a given day. The parameter should be entered in mm/dd/yyyy format surrounded by single quotes. I use it to produce a report of any jobs that failed on any given day.It should be created on the MSDB database.Example: EXEC usp_job_history '10/02/2004' This is my […]

2004-10-04

2,065 reads

Blogs

Daily Coping 2 Jul 2020

By

I’ve started to add a daily coping tip to the SQLServerCentral newsletter and to...

Presenting on Ethics in Modern Data at Houston HASSUG/SQL BI Group July 2020 Meeting

By

Looking forward to presenting with my wife Christine Assaf our talk on Ethics in...

MVP for Another Year 2020-2021

By

Early this afternoon I received an email from Microsoft presenting me with the 2020-2021...

Read the latest Blogs

Forums

Upgrading from SQL Server 2012 to SQL Server 2017 - Any Tips or Gotchas

By HookSQLDBA7

We are running SQL Server 2012 SP4 Standard Edition on Windows Server 2012 R2...

Administrating Analysts

By bob.pearman

Hi Guys, I was just wondering if any of you guys would be willing...

Calculate Target Column

By selpoivre

Hi, I have below table Sum of AP1 = 1764. I need to sql...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers