Scripts

Technical Article

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)

You rated this post out of 5. Change rating

2007-05-25 (first published: )

5,638 reads

Technical Article

Get record count for every table in a database

I wrote this code to make it easier to compare record counts between a live database and a restored copy to test my backups, I thought people might find it useful. You need to run it against your live side when you do the backup that you're going to restore and compare against.Copy the output […]

5 (1)

You rated this post out of 5. Change rating

2007-05-24 (first published: )

2,736 reads

Technical Article

Display results VERTICALLY in Results window

DESCRIPTION:This procedure will allow you to display results vertically (down) instead of across the screen. It's great when you are dealing with a query that has 50 columns and just a couple of records. LIMITATIONS: * It will be very slow if you are trying to return a lot of records. Works best for queries […]

1 (1)

You rated this post out of 5. Change rating

2007-05-23 (first published: )

2,901 reads

Technical Article

Dynamic and Unique field Select creator

DESCRIPTION:This procedure produces a SELECT statement which explicitly lists all fields for 'tablename' with fieldname and alias as the column name. The SELECT it produces is ready to run or if you need to join several tables just copy the column names off the SELECT it generates. I use this a lot when I create […]

4 (1)

You rated this post out of 5. Change rating

2007-05-22 (first published: )

173 reads

Technical Article

Monitor Database Growth

This code provides a way of monitoring the growth of all your databases within a single instance. The first part is the creation of a monitoring table with the initial load of current databases and sizes. The second part is the SQL that can be put in a scheduled job to automate the growth monitoring.It […]

4.84 (19)

You rated this post out of 5. Change rating

2007-05-16 (first published: )

24,350 reads

Technical Article

Function returns String in Proper Case [CamelCase]

This is a generalised Function that will return a String in Proper Case [Camel Case]. Means Afetr every space, first later will be in UPPER Case.Example:Input String: 'microSoft sql server'Output String: 'Microsoft Sql Server'

4.75 (8)

You rated this post out of 5. Change rating

2007-05-09 (first published: )

19,835 reads

Blogs

SQL Server Distributed Availability Groups and Kubernetes

By

A while back I wrote about how to use a Cross Platform (or Clusterless)...

Webcast Tomorrow on SQL Server Disaster Recovery

By

Tomorrow, November 19, 2024, at 1 PM EST, I'm giving a webcast on SQL...

SQL Server Quickie #48 – Azure SQL Managed Instance

By

Today I have uploaded SQL Server Quickie #48 to YouTube. This time I’m talking...

Read the latest Blogs

Forums

Converting job_id to join to another table.

By Brandie Tarvin

I need help, please! I have a monitoring table that pulls in information about...

SSMS 20.2 on Windows11 not able to connect to SQL 2005 ??

By Johan Bijnens

We still have a couple of dino's. What should I check to re-enable access...

Agent job security account

By onkarnath.tiwary

Hi All, I have few sql server agent scheduled jobs which are supposed to...

Visit the forum

Question of the Day

What's the Ceiling?

What do I get as the results from this code?

SELECT CEILING (999.999), CEILING (-999.999);

See possible answers