Scripts

Technical Article

HexToSmallInt

Hans asked if it could be faster. This is about 10% faster; not much. His is admittedly more readable, and mine will act very strangely with invalid hex digits.How does it work? I'm converting the string '1234' to the value 0x31323334 (for example), then subtracting '0000' so that it is 0-based in each byte (CONVERT(INT,0x30303030) […]

You rated this post out of 5. Change rating

2005-05-16 (first published: )

131 reads

Technical Article

SQL Blocking and Blocked Proc + Notifi - Part2

Based on the script by Paul Delmarche ( http://www.sqlservercentral.com/scripts/contributions/1482.asp ).Updated to now include the spid, username, blocked and blocking SQL statements in the email (still logged to table).Schedule the procedure to run at defined intervals (I use 2 minutes)

5 (1)

You rated this post out of 5. Change rating

2005-05-12 (first published: )

1,425 reads

Technical Article

Restore Multiple Backup Logs

Use This Script to restore Multiple Log backups from a Log Device file. The script will restore all the logs on the device and will leave the databse ready to use after finish. Before running this script you must verify if the database is in No recovery mode or read only state

5 (1)

You rated this post out of 5. Change rating

2005-05-09 (first published: )

432 reads

Technical Article

Grant EXECUTE permission to users

This procedure will assist in granting execute rights to a database user to all the stored procedures in a database The parameters to this procedure are the databasename and the username to whom EXECUTE rights need to be given to The assumption here is that the user already has access rights to the database mentioned […]

You rated this post out of 5. Change rating

2005-05-05 (first published: )

220 reads

Technical Article

HexToINT

An optimized function for converting a HEX string into a INT. Built for being faster then other HexToDec converters.Slightly slower then HexToSMALLINT.If there is any faster function to do this conversion, I am intrested of using it instead.

You rated this post out of 5. Change rating

2005-05-04 (first published: )

285 reads

Technical Article

Script to Move Indexes off of the Primary Filegrou

This is a stored proc that will move your indexes to two new file groups. A Cindex file group is for the clustered indexes and NCindex file group is for non clustered indexes. The parameters for this procedure are @CPATH - the path to the clustered index datafiles @NCPATH - the path to the nonclustered […]

1 (1)

You rated this post out of 5. Change rating

2005-04-29 (first published: )

382 reads

Technical Article

Execute SQL-DMO Database method on all databases

This script allows you to specify a method and a server (or multiple servers.) It will then execute the method on every database on the server. With very minor tweaking you could have it search for the servers, then call the server db script with each one, or add another nesting to call tables or […]

You rated this post out of 5. Change rating

2005-04-27 (first published: )

710 reads

Technical Article

usp_KillUsers2

This script expands on the usp_KillUsers script posted by Brian Knight, by adding the text of the process that is being killed and will even kill users who are accessing the database from with in a process of another database. Does not contain the NET SEND option though.

You rated this post out of 5. Change rating

2005-04-22 (first published: )

298 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

Pivot Help

By mashispano

Hi Guys I need help pivoting the following SELECT [ID],[code_name],,[retail_price] FROM products 1 |...

Writer methods in PowerQuery (LOL)

By pietlinden

I'm using PowerQuery in Excel on my desktop. (Yeah, I know you can do...

Need help with GROUP BY...

By iamjoe

Here's my data... I am trying to return total days in status for each...

Visit the forum

Question of the Day

The Density Vector

When building statistics, there is the concept of density that refers to the duplicates in a table. How is this calculated?

See possible answers