Author Archives: ben

SQL Server HTML to Plain Text Function

This week, I had a requirement to convert some HTML text in a SQL column to plaintext and store that plaintext in a different database. I found this solution for html to text, but it’s using a WHILE loop and … Continue reading

Posted in MS SQL, Transact SQL | Leave a comment

Validating a Bank Routing Number on a Web Form

Have you ever had to collect a routing number and bank account number on a web form? I’ve worked on a lot of software where we collected this information (I’ve spent a lot of time on banking systems), but never … Continue reading

Posted in Uncategorized | Leave a comment

SQL Tricks – Remove Interior Spaces

This week, I was given a set of data to import to a database. After the import, I noticed that the source data had lots of unnecessary spaces all over the place. I can, of course get rid of leading … Continue reading

Posted in MS SQL, Transact SQL | Tagged , , , , , , , | Leave a comment

Vigenere By SQL

After that previous post, I suppose it was natural for me to wonder what it would take to apply Vigenere cypher logic using T-SQL. I knew right off that the code would look much different. Mainly, because my self-imposed rule … Continue reading

Posted in MS SQL, Transact SQL | Tagged , , , , , , , , , , , | Leave a comment

Coding Vigenere Cyphers

Recently, I rewatched The Prestige, the very good Christopher Nolan move where Hugh Jackman and Christian Bale play rival magicians in the late 1800s. Jackman’s character has an old journal, written in cypher text that he slowly and meticulously needs … Continue reading

Posted in Javascript, Swift | Tagged , , , , , , | Leave a comment

SQL For Fun: Parsing the iTunes XML

What happens if one part of your personality is data-parsing nerd and another part is music lover nerd? You end up trying to answer questions like, “Which songs did I have rated with 4 stars last year that are lower … Continue reading

Posted in Apple, iTunes, MS SQL, Transact SQL | Leave a comment

Using Tally Table to Remove Invalid XML Characters

A couple of weeks ago, I was called in to troubleshoot an error occurring in a SQL stored procedure. The procedure was selecting a variety of information out as XML data. The error occurred because on of the columns being … Continue reading

Posted in MS SQL, REGEX, Transact SQL | Tagged , , , , | Leave a comment

Using SQL to Mege Three Incomplete Data Sets

You can join data sets. LEFT JOIN, RIGHT JOIN, even OUTER APPLY. There’s nothing to learn here. Last week, I had what seemed to be a simple join of three data sets. My permutation was a lot more complicated than … Continue reading

Posted in MS SQL, Transact SQL | Tagged , , , , , , , | Leave a comment

Find DTS and FTP Job Steps From msdb

I started a new full-time contract this month, which is always weird. Not having a full understanding of the project, access rights roadblocks, and unfamiliarity with the code base all team up to make days feel long and unproductive. One … Continue reading

Posted in MS SQL | Tagged , , | Leave a comment

Logical Tests Using OR in Crystal Reports

Consider these two formulas in Crystal Reports:

One would think that these two should behave the same, right? In fact, the results are different if Table.Value is null. In the first case, “if isnull({Table.Value}) gets evaluated first. Since … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , | Leave a comment