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 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 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 (@AdamMachanic), 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...
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.