Scripts

Technical Article

Function to encript password

If you need to save password for you application in tables, with this function you can save them encripted. And with another published function (check the page to find the script) you can desencript it. The function receives the password,  modifies every character and returns the encripted password.

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2004-03-18

640 reads

Technical Article

Drop Indexes

This script drop all indexes from table, including Primary Key contraint. First it del nonclustered indexes, then clustered and at last - drops PK contraint. This scirpt is useful, when you need drop all indexes, like when doing ETL process.

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(1)

You rated this post out of 5. Change rating

2004-03-17

554 reads

Technical Article

Difference between dates with thousands separators

This function calculates the time difference between 2 datetimes and displays the results in the following format:H,HHH,HHH:MM:SSThe return is a 15 character field that is left padded with spaces so that the field becomes right justified.  This makes the colons line up for easy reading.  Commas are automatically added as thousands separators as needed by […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(2)

You rated this post out of 5. Change rating

2004-03-14

461 reads

Technical Article

tighter approach to counting strings in strings

Saw Mike's routine for counting occurences of a string in a string and I thought I'd offer a simpler solution.Simply replace the occurence with null and use length differences as shown.NOTE: len may ignore trailing spaces, so this can be made more solid by adding some non printable char (less likely to interfere with operation) […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2004-03-10

102 reads

Technical Article

Count number of strings within a string

This function will return the number of occurrences of one string within another string. I was looking for something like this recently, and the only thing I could find was needlessly complicated. Don't forget, when calling a scalar function, you must qualify with username like this:Select dbo.StringCount('Hi There','e') This function may be a little too […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2004-03-09

380 reads

Technical Article

Kill all SPIDs with a certain user ID

This script is used to disconnect all connections by a particular individual to a server. I use it when I have to disconnect somebody and they have too many processes to do it by hand. Normally, you can just connect the offending process, but if there are multiple processes that are causing a problem , […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2004-03-08

2,907 reads

Blogs

Flyway Tips: Object History

By

It’s a small change, but a handy one. Flyway Desktop (FWD) now includes the...

Car Update September 2026

By

Software is hard. While I love our Lucid Gravity, I realize that they are...

Microsoft Tools for Making Data AI-Ready

By

Making Data AI-Ready, Part 2 (This is the second article in a three-part series...

Read the latest Blogs

Forums

Looking for old SQL Server 1.x - 4.21 disks, manuals, boxes, etc.

By Mike Scalise

Hi everyone, I'm hoping some of the longtime SQL Server professionals here might be...

Checking the Error Log II

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Checking the Error Log II

Parameter Sniffing on SQL Server 2025: A Walkthrough with Real Numbers

By deepeshdhake

Comments posted to this topic are about the item Parameter Sniffing on SQL Server...

Visit the forum

Question of the Day

Checking the Error Log II

What is the reason I should change my old code that uses xp_readerrorlog?

See possible answers