Technical Article

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 […]

You rated this post out of 5. Change rating

2006-08-17 (first published: )

1,111 reads

Technical Article

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.

You rated this post out of 5. Change rating

2005-12-29 (first published: )

2,253 reads

Technical Article

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 […]

You rated this post out of 5. Change rating

2004-12-16 (first published: )

383 reads

Blogs

Learn about Modern Microsoft Apps in San Diego

By

I wrote about learning today for the editorial: I Can’t Make You Learn. I...

How To Deploy Fabric SQL and Azure SQL Databases with Azure DevOps

By

Fabric has CI/CD built in, but if you've tried to use it for database...

A New Word: Attriage

By

attriage – n. the state of having lost all control over how you feel...

Read the latest Blogs

Forums

ALAMAT BCA KCU PEMATANG SIANTAR TLP/WA 08217555651

By m4rt1n4

TLP/CS 08217555651 Jl. Merdeka No.39, Proklamasi, Kec. Siantar Bar., Kota Pematang Siantar, Sumatera Utara...

Alamat Kantor Bank BCA KCP Lomanis Telp:08218154393

By m4l4mt194

WA:08218154393 Jl. Gatot Subroto No.080A, RT.001, Cigobang, Gunungsimping, Kec. Cilacap Tengah, Kabupaten Cilacap, Jawa...

Alamat Kantor Bank BCA KCU CILACAP Telp:08218154393

By layanan0013

WA:08218154393 Jl. Jend. Ahmad Yani No.118, Sidakaya Dua, Sidakaya, Kec. Cilacap Sel., Kabupaten Cilacap,...

Visit the forum

Question of the Day

BIT_COUNT II

In SQL Server 2025, I have a table (dbo.UserPermission) that contains this data:

UserID  UserPermissions
15
23
37
4       NULL
What is returned when I run this code:
select bit_count(UserPermissions) as PermissionCount
from dbo.UserPermission
where UserID = 4;

See possible answers