Scripts

Technical Article

INSTR Function

INSTR searches string for substring. --> position is an integer indicating the character of string where SQL Server begins the search. -->If position is negative, SQL Server counts and searches backward from the end of string. occurrence is an integer indicating which occurrence of string SQL Server should search for. The value of occurrence must […]

3 (2)

You rated this post out of 5. Change rating

2002-11-12

1,328 reads

Technical Article

sp_kill

This stored proc has helped me a lot when I needed to restore db, reconfigure replication, and do other database jobs. SQL server KILL command can only act on a single spid. This sp compiles KILL commands in a cursor to kill a group of spids based on database name, login name, host machine name […]

You rated this post out of 5. Change rating

2002-11-11

5,796 reads

Technical Article

Converting Binary data to a Hex Character String

Occassionally you might want to convert a binary number into some printable string.   This would allow you display some meaning fully numbers hex characters, instead of just some unreadable garbage.  This script takes a binary field, of basically any length, and converts it, character by character, to a character string.  The character string will contain […]

You rated this post out of 5. Change rating

2002-11-07

455 reads

Technical Article

Drop Statistics

This procedure was created to automate the dropping of statistics on a user specified table.  Very simple code, but handy if the need is there.Replace 'tablename' throughout script with the name of the table intended to temporarily house the statistics name(s).

You rated this post out of 5. Change rating

2002-11-01

1,051 reads

Technical Article

Execute DTS package using OA procedures

This script will execute a DTS package using the sp_OA stored procedures. It accepts six parameters which specify the server name, security mode flag, userid, password, package name and optional package password.Eg:For SQL SecurityEXEC usp_ExecDTSPackage @vcrSrvr='Server', @bitIntSec=0, @vcrUID='UserID', @vcrPWD='Password', @vcrPkgName='Package Name', @vcrPkgPWD='Package Password'For Windows SecurityEXEC usp_ExecDTSPackage @vcrSrvr='Server', @bitIntSec=1, @vcrPkgName='Package Name', @vcrPkgPWD='Package Password'It uses a function […]

You rated this post out of 5. Change rating

2002-10-31

350 reads

Technical Article

Find and Replace VBScript within DTS Package

This script will find and replace specified text within all ActiveXScript tasks with a certain text string in the description. It was designed on SQL 2000, but I think it will run on SQL 7 as it doesn't reference any SQL 2000 specific properties. It opens a package object and then loops through the steps […]

You rated this post out of 5. Change rating

2002-10-31

621 reads

Technical Article

Find Procedures and tables by column

The stored proc FindObjByColumn_sp, while simple, is extremely useful when making database changes or for any reason that you need to find any tables and stored procedures that contain a particular column.  It searches the system tables of a database to find the object containing the column.  In addition, the procedure automatically adds a wildcard […]

You rated this post out of 5. Change rating

2002-10-31

426 reads

Blogs

Replacing Images in PBIR Format Reports

By

With the PBIR format of Power BI reports, it’s much easier to make report...

Capturing Ideas for Blogs

By

As we close out the year, I decided to drop this post here and...

A New Word: Lilo

By

lilo– n. a friendship that can lie dormant for years only to pick right...

Read the latest Blogs

Forums

The Oldest Article

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Oldest Article

Happy New Year 2025

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Happy New Year 2025

Using a RETURN

By stevec883

How does this capture multiple values from a cursor, and put them into an...

Visit the forum

Question of the Day

The Oldest Article

What's the oldest article on SQL Server Central (take a guess)?

See possible answers