Scripts

Technical Article

Add Check Digit (LUHN)

If you ever need to create a credit card like number this stored procedure is for you.Most credit cards contain a check digit, which is the digit at the end of the credit card number. To generate the check digit, the LUHN formula is applied to the number. To validate the credit-card number, the check […]

You rated this post out of 5. Change rating

2002-11-30

4,108 reads

Technical Article

Check user activity

This stored procedure is another monitoring utility that can be executed periodically as a sql server agent job. The procedure checks if there are any open connections, and if there was any recent user activity within a given period of time in a given (or any) database by a given (or any/any except given) login […]

You rated this post out of 5. Change rating

2002-11-30

1,272 reads

Technical Article

Delete old versions of DTS packages

This script will remove old versions of DTS packages. It accepts a single parameter which is used as a filter criteria on the package name. It will also remove package log records for the version that is deleted.EXAMPLE: EXEC usp_DelOldDTSPkgVersions @vcrPkgName = 'Devel'This will delete old versions for packages that have 'Devel' in the nameQuestions […]

5 (2)

You rated this post out of 5. Change rating

2002-11-30

1,147 reads

Technical Article

Remove old DTS Package versions

This Procedure is what I use to clean out all the old DTS package version on my server periodically. You just place it in the msdb database and run it as you need to.Note: Although I have never had an issue with it, I do suggest backup msdb database beforehand, just in case you wack […]

5 (1)

You rated this post out of 5. Change rating

2002-11-30

310 reads

Technical Article

Setting permissions (Updated: UDF's now set)

Here is a script I wrote to automate updating of permission on a database. Often running as sa I forget to set the rights for objects when distributing db objects. It provides the capability to process only certain object types, and whether or not to print and execute the persmissions change or just print out […]

You rated this post out of 5. Change rating

2002-11-22

449 reads

Technical Article

Grant/Revoke EXEC permissions  for all procs in DB

Useful in dev environments when you need to periodically assign execute permissions on all procs in a db (drop/create scripts may have been run without re-assigning permissions)Accepts DB name, ProcLike for matching 'starts with' pattern against proc names in DB, revoke (optional - defaults to 0/True) specifies wheter to GRANT or REVOKE permissions

You rated this post out of 5. Change rating

2002-11-21

392 reads

Technical Article

Monitoring SQL Server downtime

The following script creates a monitoring utility to find out for how long a sql server was down prior to the latest startup. The script creates one table (tblHeartbeat), four stored procedures (uspFillHeartBeat, uspGetDowntimeSummary, uspCleanHeartbeat, uspAtStartup) and two jobs (FillHeartbeat and CleanHeartbeat).Notes:1. By convention I introduced in my company (UGO Networks, Inc.) all "service" database […]

You rated this post out of 5. Change rating

2002-11-21

801 reads

Blogs

Advice I Like: Experience and Aptitude

By

Experience is overrated. Most breakthrough accomplishments were done by people doing them for the...

Plan Time for Self-Development

By

As you begin the new year, if you don't already have time set aside...

BK’s Bookshelf: Never Split the Difference

By

I picked up Never Split the Difference: Negotiating As If Your Life Depended On...

Read the latest Blogs

Forums

Insiders Selling Data

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Insiders Selling Data

Join 2 tables

By mtz676

Table A ServerName ColB ServerA C ServerA I ServerA L ServerA M ServerA N...

Impact of Not Including Foreign Keys in an SQL Archive Database

By abdalah.mehdoini

Hello everyone, I am about to start a data archiving project that will affect...

Visit the forum

Question of the Day

Quiesce

What does it mean to quiesce a system?

See possible answers