There are lots of ways to remove time from a date, but most of them are extremely inefficient.
SQL Server
This post explores the performance characteristics of several solutions to the median problem.
Playing around today, I discovered that I was locked out of my local named instance using the Dedicated Administrator Connection. This post shows why and explains how you can avoid getting shut out of your own instance.
Sometimes it can make sense to check for potential errors and prevent them, instead of letting them happen.
Some interesting discussions always evolve around the topic of splitting strings; here I show splitting on the database side may not be necessary in the first place.
There were a lot of comments following my post last week about string splitting, and I have tried to address those here.
This week I came across a case where DRY should be thrown out the window. There are other cases too; this one involved bitwise operators.
In this tip, I show how to remove MDW – which involves more steps than you might expect.
I explore some common approaches people use to split strings, complete with performance analysis.
Tip : Script to rename constraints and indexes to conform to a naming convention
Tip : Getting Started with SQL Server 2012 Express LocalDB
Tip : Maintaining SQL Server default trace historical events for analysis and reporting
I talk about how your SQL Server instance might not be firing on all cylinders if you get into this licensing scenario.
Tip : Storing E-mail addresses more efficiently – Part 2
This one time, I traveled over 18,000 miles and had 26 net time zone changes, all to give a couple of sessions.
Tip : Storing E-mail addresses more efficiently – Part 1
A long, long time ago, ORDER BY in a view meant something. People still think so. Read why…
Tip : Checking for potential constraint violations before entering SQL Server TRY and CATCH logic
By way of an example, see why most of what you hear about SQL Server is only true some of the time, at best.
Tip : Troubleshooting IntelliSense in SQL Server Management Studio
Talking about the common misconception that a while looper is faster than a cursor (and why it's still a cursor).
In this tip, I talk about the snippets feature in Management Studio, to encourage consistent coding conventions.
See why I prefer alias = expression
over the more standards-compliant expression AS alias
syntax.
In early 2012, I review some of my community contributions and travels from 2011.
For this month's T-SQL Tuesday, I talk about UTC, DST, and offsets.
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...
I show a dynamic SQL query that shows the number of rows that contain NULL in a certain column.
For this month's T-SQL Tuesday, we're talking about procedures and functions.
See several examples supporting the idea that you should use catalog views, not INFORMATION_SCHEMA, in SQL Server.
See why you might be getting unexpected syntax errors when using builtins within table-valued function calls.
See a quick metadata script that finds all tables, across all user databases, without a primary key.
Learn why you shouldn't use BETWEEN for date range queries, even with the date data type.
On older versions of SQL Server, it was tedious work tying DBCC INPUTBUFFER output to active requests. See one way we used to do this.
For this month's T-SQL Tuesday, I talk about EXCEPT (and INTERSECT) as possible replacements for clunky join syntax.
I talk about a couple of minor changes to Policy-Based Management in SQL Server 2012.
When EOMONTH was first announced, I questioned its value, and thought BOMONTH would have been more useful.
See why you should use sp_executesql instead of EXEC() for running dynamic SQL strings.
See an example that defies a generalization about performance: getting the largest value in a column.
For this month's T-SQL Tuesday, I talk about redundant string building.
I chase down whether sp_hexadecimal is a system stored procedure, and it only further proves you should avoid sp_
.