relatively simple mode, median, mean

Here's a sample script to help you get some generic mode, median, and mean statistics for something. In my example, I'm getting the number of days something takes to start and stop some task. The idea is that I'd have a fairly short list of jobs, and record would record the job id, and start/stop […]

2006-08-17 (first published: )

918 reads

Change column collations back to database default

This script will create a single-line ALTER TABLE statement for each column in any table to change the collation to match the 'database default'. This is best accomplished in the Query Analyzer -- simply run the script, select all the records, and paste them into a new window to run them.

2005-12-29 (first published: )

678 reads

Large auto-job-creation script for adding backups

This script creates a stored proc that was intended to run from a trigger on the master..sysdatabases for each database creation. Alas. It will create three jobs for each database you apply it to. First, it'll create a job to run a full backup each Sun, at 5am (see below). Those backups will be retained […]

2004-12-16 (first published: )

366 reads

Blogs

Actual Difference Between EXISTS(SELECT 1 …), EXISTS(SELECT * …), and EXISTS(SELECT column …)

By

Is EXISTS(SELECT 1 ...) better than EXISTS(SELECT * ...)? Who would know better than...

ANSI_WARNINGS = OFF can break update statements with some SQL features

By

Working on a SQL 2017 database where an external, non-Microsoft application has direct access...

Bring Your Own Key to Azure SQL Database Managed Instance TDE

By

Last year Azure SQL Database Managed Instance saw the introduction of bring your own...

Read the latest Blogs

Forums

How to handle date on temp table when is null or not ?

By ahmed_elbarbary.2010

How to handle date on temp table when is null or not ? I...

Recruitment question

By mcmiller1986

Thanks for fielding this question in advance: We are searching for a Microsoft SQL...

SQL Group by in STUFF function

By chowdarydeepus@gmail.com

I have one question in SQL and would like to take some help from...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers