Scripts

Technical Article

IsDateAHoliday UDF **NEW**

This is a replacement script for the first IsDateAHoliday. The first one was too slow and inefficient. This one is much better. Enjoy.IsDateAHoliday is a User Defined Function that accepts a date and returns a 1 if date is a national holiday and returns a 0 otherwise.The holidays are:New years Day, MLK Day, Presidents Day, […]

3.5 (2)

You rated this post out of 5. Change rating

2005-06-03

407 reads

Technical Article

Get the #lines in a TSQL view/SP/UDF of a String

The following procedure gets a TSQL program object(View/UDF/stored procedure) and a given stringIt searched object's source code for the string and returns the number of lines where a match is found.This is helpful when we want to search all our TSQL code for a specific table name, column etc. and investigate where it is referenced […]

You rated this post out of 5. Change rating

2005-06-02

101 reads

Technical Article

Generate Insert Statements Easily - Updated

This script will generate insert statements for the given tables. You can pass the tables names, separated by commas, into sp_DataAsInsCommand stored procedure as in the example below:EXEC sp_DataAsInsCommand 'employee,titleauthor,pub_info'Updated on 5/25/01 to correct an issue with columns that are short like a column defined as char(1), to correct another issue with the Identity column […]

You rated this post out of 5. Change rating

2005-06-01 (first published: )

335 reads

Technical Article

Check missing exec permission on Stored proc

Stored procedure usp_CheckMissingPermission_for_User checks missing exec permission for given user or group on all the stored procedures within the database. It not only detects missing exec permission, but also generates a scripts for you to fix the problem.

You rated this post out of 5. Change rating

2005-05-30 (first published: )

228 reads

Technical Article

Generates Filegroup listing on a db for each table

This script generates filegroup listing on a given database for each table within the database. This will be very handy to indentify which table is built on a particular filegroup. This is useful for a VLDB (very large database).

5 (1)

You rated this post out of 5. Change rating

2005-05-27 (first published: )

437 reads

Technical Article

Backup DB and Email

I have the need to backup multiple MS SQL databases and email to a support email address.I have added on an original script to produce a fairly robust db back and email script.You can either email the db or just a notification of backup.Script will also maintain db's for a set length of time before […]

You rated this post out of 5. Change rating

2005-05-20 (first published: )

323 reads

Blogs

Spark Connect Dotnet November 2024 Where are we?

By

All Spark Connect Posts Introduction There have been quite a few changes in the last...

A New Word: Ochisia

By

ochisia – n. the fear that the role you once occupied in someone’s life...

Create a Numbers Table in Power Query

By

This is a quick blog post, mainly so I have the code available if...

Read the latest Blogs

Forums

How Do You Patch 100 Database Servers?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item How Do You Patch 100...

Microsoft SQL announcements at PASS Data Community Summit 2024

By Press Release

Comments posted to this topic are about the item Microsoft SQL announcements at PASS...

How to Develop Custom T-SQL Code Snippets in Azure Data Studio

By Noman072

Comments posted to this topic are about the item How to Develop Custom T-SQL...

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