Now there are two ways to ask me your SQL questions! I’ll be reviewing posts on this site Monday through Fridays. I check twice a day, the first is before 0800 (utc-5) and the second is at lunch. Feel free to drop by and ask any questions you’d like! Don’t forget you can ask them…
I’m a Qualified Expert!
After a week of contributing to Experts Exchange, I’ve reached the first level. This is an honor! I’m glad I get to help people with their SQL questions. I look forward to answering many more… after all, the next level is calling! If you have any questions, and you want to post them on Experts…
Sorting Numbers in VarChar field
Over at Experts-Exchange, I saw a question I get every once in a while. It all has to do with how SQL Server orders data in a VARCHAR column. SQL Server tries to sort a VARCHAR column in a dictionary order, 0 comes before 1. The problem is you may have mixed numbers in your…
Migrating Databases to Azure
When converting a database from an older version of Microsoft SQL to Azure, there will be many gotchas along the way. I’d like to help you learn from the troubles I had along the way, hopefully sparing you a bit of time that was lost during my first conversion. Getting Started I’m going to assume…
Stormtroopers 365
Over on flickr there’s a great set of images using Star Wars Action figures. Check them out!
Converting VARCHAR to DATETIME
Recently a post was made on LinkedIn asking how one would convert a date stored in a VARCHAR field could be converted to a DATETIME so date math could be performed. Unfortunately, this problem is more common than it should be. If users are given a free-form field to enter data, they’ll often enter unreliable…
SQL Injection License Plate
While it would be nice to put my knowledge of SQL to work in such a way, I highly doubt this injection attack would do much to prevent getting a ticket. But it should make you consider the possibility that this code could do damage to one of your projects, should someone try to enter…
UNION, INTERSECT, and EXCEPT
Earlier today I was discussing methods you can use to differences in data sets between two tables or views. My colleague was discussing the usual method SELECT columName(s) FROM table1 t1 (READCOMMITTED) LEFT JOIN table2 (READCOMMITTED) ON t1.sharedKey = t2.sharedKey WHERE t2.sharedKey IS NULL While this is a perfectly cromulent way of finding out what…
SQL 201-Formatting Dates in Microsoft SQL
One of the more frequent questions I get for SQL Server is how to format a DATETIME into a specific date format. Here’s a summary of the different date formats that come standard in SQL Server as part of the CONVERT function. Following the standard date formats are some extended date formats that are often…
New Job
After several months of consideration, I’ve changed jobs. I’m now at Wachovia in the university area. It’s much closer, My commute is just 12 miles now! I’m contract so there isn’t as much pressure to work long hours. And even with the additional protocols, I find more freedom in the ability to fully utilize the…