Miscellaneous

Technical Article

faster dbo.ufn_vbintohexstr - varbinary to hex

  • Script

Here's an alternative to Clinton Herring's ufn_vbintohexstr which should be much faster with large varbinary values. First, in his original version, the inner-loop CASE statements can be replaced with this: select @value = @value + CHAR(@vbin/16+48+(@vbin+96)/256*7) +CHAR(@vbin&15+48+((@vbin&15)+6)/16*7) How does it work? By adding 6 to a hex-digit in (@vbin&15), you have a value from 16 […]

You rated this post out of 5. Change rating

2006-12-20 (first published: )

123 reads

Technical Article

HexToInt

  • Script

Challenged by Hans Lindgren's stored procedures of the same name, I created this. Note that it produces strange results on non-hexadecimal strings, overflows at 0x80000000, and could have issues with byte-ordering on some architectures.How does it work? Well, the distance between one after '9' (':') and 'A' is 7 in ASCII. Also, if I subtract […]

You rated this post out of 5. Change rating

2006-12-15 (first published: )

209 reads

Technical Article

HexToSmallInt

  • Script

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: )

142 reads

Technical Article

SQL Blocking and Blocked Proc + Notifi - Part2

  • Script

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,430 reads

Technical Article

usp_get_all_stats_date

  • Script

This script gathers stats_date and index information for all of the current database. Please feel free to modify it as it is made up of components that are available on this site here- http://www.sqlservercentral.com/scripts/contributions/97.aspand a BOL entry for stats_date.I needed this information and thought I would share it.

You rated this post out of 5. Change rating

2006-07-17 (first published: )

555 reads

SQLServerCentral Article

Selecting a Web Host for your SQL Server Driven Website Part 2

  • Article

Many of us have SQL Servers at work that we learn on, test with work, etc. But getting your own SQL Server for a website can be a tricky thing. Especially on a budget. Or maybe your company wants to have their website hosted. Before you spend any hard earned money, read part 2 of this two part series by Jon Reade on what to look for when setting up a SQL Server hosting company.

You rated this post out of 5. Change rating

2005-04-20

5,377 reads

Technical Article

User-Defined string Functions Transact-SQL

  • Script

GETWORDCOUNT, GETWORDNUM, AT, RAT, OCCURS,CHRTRAN, STRFILTER, PADC, PADR, PADL, PROPER, RCHARINDEX etc. AT, PADL, PADR, CHRTRAN, PROPER are similar to functions Oracle PL/SQL INSTR, LPAD, RPAD, TRANSLATE, INITCAP. In my humble opinion, it will be convinient to apply such functions for writing of stored procedures and User-Defined Functions on Transact-SQL. Please, download the file http://www.universalthread.com/wconnect/wc.dll?LevelExtreme~2,2,27115

You rated this post out of 5. Change rating

2006-01-10 (first published: )

1,554 reads

Blogs

Solving SQL Server Mysteries with a Whole Gang of Sleuths -Scooby Dooing Episode 4

By

One thing I’ve always loved about the Scooby-Doo cartoon is that he never solved...

SQL Server Availability Groups

By

Flexibility and Scale at the Database Level When SQL Server 2012 introduced Availability Groups...

Modify Power BI page visibility and active status with Semantic Link Labs

By

Setting page visibility and the active page are often overlooked last steps when publishing...

Read the latest Blogs

Forums

Password Guidance

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Password Guidance

Using table variables in T-SQL

By Alessandro Mortola

Comments posted to this topic are about the item Using table variables in T-SQL

Azure elastic query credential question

By cphite

I am trying to check out elastic query between two test instances we have...

Visit the forum

Question of the Day

Using table variables in T-SQL

What happens if you run the following code in SQL Server 2022+?

declare @t1 table (id int);

insert into @t1 (id) values (NULL), (1), (2), (3);

select count(*)
from @t1
where @t1.id is distinct from NULL;
 

See possible answers