Scripts

Technical Article

Generating sequential numbers - the fast way

It is often necessary to generate a table with sequential numbers, up to a specified upper limit N. For small N, a simple INSERT in a WHILE loop will do. But, for large N, that solution becomes too slow. This script presents a different approach. It generates sequential numbers from the binary representation of N, […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(2)

You rated this post out of 5. Change rating

2004-12-30 (first published: )

660 reads

Technical Article

Number of Weekdays between two dates - Set Based

Inspired by a post here at SQLServerCentral, I wrote this function to calculate the number of days between two dates that are weekdays. In order to achieve this I used a common SQL table that contains a sequence of number for 1 to X. This was used as an input to the datediff function, and […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2004-12-24 (first published: )

341 reads

Technical Article

Retrieving all indexes of the Database.

The Script outputs all the indexes in the Database.I have used the sp_helpIndex system stored procedure here to retrieve all the indexes available for the Table . This is extremely useful in identifying all the indexes in a database in a single query

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(2)

You rated this post out of 5. Change rating

2004-12-22 (first published: )

364 reads

Technical Article

Update multiple rows (in a set) using a single SP

Here is another variation of processing multiple records with a single procedure call but allowing for set processing.The helper functions make use of the sequencetable pattern. These helper functions can be used to parse strings into records, so one gets a list, or simply return the nth field.There are two functions that will parse into […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2004-12-17 (first published: )

809 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: )

396 reads

Blogs

Architecting Zero Downtime Deployments–Day of Data Boston

By

Here are the resources for my talk at Day of Data Boston. Slides –...

The Book of Redgate:A Prehistory

By

I’ve covered the values in a number of previous posts on the Book of...

Evidence-bound: what AgentDBA will and won’t link

By

When the evidence names the database, it says so. When it doesn’t, it stops....

Read the latest Blogs

Forums

SQL Server Storage Optimization: Multiple Files in a Filegroup vs Dedicated File

By abdalah.mehdoini

Hello, I would like to get some feedback regarding the best storage optimization strategy...

Azure SQL Database Event Log Limitations

By abdalah.mehdoini

Hi, Do you know if there is a way to get more detailed logging...

Four Rules for Adding AI Without Breaking What Already Works

By dbakevlar

Comments posted to this topic are about the item Four Rules for Adding AI...

Visit the forum

Question of the Day

Hyperscale Replicas III

In an Azure SQL Database Hyperscale Edition, how many named replicas can be configured?

See possible answers