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…
Month: March 2010
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…