Bad Habits to Kick : Using AS instead of = for column aliases
See why I prefer alias = expression
over the more standards-compliant expression AS alias
syntax.
See why I prefer alias = expression
over the more standards-compliant expression AS alias
syntax.
See why it pays to be consistent about always aliasing every table and every column in your query.
See why you shouldn't use alias types in SQL Server.
A little wisdom on using sensible and logical aliases for your tables, instead of a / b / c / d.
I talk about the evolution of my thinking on featured images, and how I use generative AI for most post companions these days.
For this month's T-SQL Tuesday, Steve Jones asks us to talk about problems we've solved using window functions.
For T-SQL Tuesday #156, I talk about the qualities I expect in T-SQL code before I consider it "production quality."
For this month's T-SQL Tuesday, I talk about a not-quite-yet-announced feature in SQL Server 2022 that has the potential to function as a low-effort bad habit logger.
For this month's T-SQL Tuesday, Deb Melkin asks us get up on our favorite soapbox. I have so many, but this time I picked a new one…
I talk about why I prefer CONVERT over CAST to be consistent. Basically, if you sometimes HAVE to use only one, why not just ALWAYS use that one?
I talk a bit about bit columns: names with negative context, allowing NULLs, and using cryptic BITWISE operators instead of readable, self-documenting expressions.
An index of over a decade's worth of posts and videos involving bad habits and best practices in SQL Server.
I talk about a couple of subtleties of THROW, and how to avoid frustrating bouts of troubleshooting.
I investigate a deadlock issue with alias types and table-valued parameters, and the Connect items that have sprung up about this issue.
This month's T-SQL Tuesday is being hosted by Allen White (@SQLRunr) and is about sharing your T-SQL tips and tricks. Since I know many people will share their T-SQL magic and wizardry, I thought...
See several examples supporting the idea that you should use catalog views, not INFORMATION_SCHEMA, in SQL Server.
Read about some date/time shorthand you should avoid.
Yes, Adam is right: we've all written crap code (the topic of this month's T-SQL Tuesday Wednesday. Usually we have an excuse: tight deadline, short shelf life of the code, or didn't know any...
T-SQL Tuesday, the invention of Adam Machanic, is what he calls a recurring, revolving blog party. Each month, a new host picks a topic, invites bloggers of all levels to join in, and then...
Okay, I'm following the lead of Joe Webb, who recently posted My Most Popular Posts From 2010. I think it can be a very useful exercise to go back and look at what blog...
Fellow MVP Hugo Kornelis (blog) has suggested that the proprietary UPDATE FROM and DELETE FROM syntax, which has worked for several SQL Server versions, should be deprecated in favor of MERGE. Here is the...
I talk about some questionable choices by the SQL Server naming committee.
See some new metadata-related features introduced in SQL Server 2012.
Earlier, I documented the system objects that have changed in Denali. One that caught my eye was a slew of new columns made available through sys.databases, mostly to support a feature I also blogged...
While it's still only the CTP1 timeframe, getting a glimpse of the changes in system objects can start preparing you for what's coming – especially when there are potential breaking changes, as you'll see...
In my last post in this series, I talked about inconsistent table aliasing. Today I was reminded of another behavior that DBAs and developers alike can be lazy about: keeping Books Online current. There...
I tried to deploy nested stored procedures that both had a cursor with the same name. SQL Server didn't like it.
About two months ago, I began planning a cluster migration for one of our primary SQL Server 2005 clusters to newer hardware, and a simultaneous upgrade to SQL Server 2008 SP1. The old system...
See why you should always use alias or column names in your ORDER BY clauses, rather than ordinal position.
So my Saturday was basically ruined by the following: sys admin makes a minor adjustment to the system clock on the data center's domain controller, Friday @ 6 PM. while correcting the time, said...
When developing stored procedures, there seems to be a lot of emphasis on "get it done fast." Which means type all lower case, pay little attention to formatting, and sometimes throw best practices out...
While playing with the new Policy-Based Management (PBM) features of SQL Server 2008 the other day, I came across a really annoying syntax implementation that is going to trip up a lot of people...
[Updates below in BOLD.]On loading SSMS for the first time, I noticed a few things. First of all, the row(s) affected message is now prefixed with information on the instance and login relevant to...