Archive for the ‘Code’ Category
#TSQL2sDay 003: Maslow and relational design
Rob Farley is hosting the third installment of TSQL Tuesday, and it’s a fun one: relationships (in honor of Valentine’s Day). While I’m not currently in much of a mood to opine on the virtues of love and databases, I did think I wanted to post something a bit more esoteric this time. Not many [...]
February 9, 2010
Posted in: SQLServerPedia Syndication, TSQL2sDay
No Comments
#TSQL2sDay 001: Date/Time Issues and Data Modeling
This is my first post for T-SQL Tuesday (thanks, Adam, for the idea!); I’m hoping this will be a continuing block party, and hopefully connect a lot of us SQL bloggers together. There’s a lot of great content out there, and sometimes it’s just tough to find.
Just a few notes before I get started on [...]
December 8, 2009
Posted in: TSQL2sDay
One Comment
Good Habits To Adopt: Enforcing the natural primary key
I’ve been reading Aaron Bertrand’s great series of blog posts on bad habits to kick, and have been thinking to myself: what are some good habits that SQL Server developers should implement? I spend most of my day griping about bad design from vendors, yet I hardly ever take the time to document what [...]
October 22, 2009
Posted in: Good Habits, SQL, SQLServerPedia Syndication
3 Comments
<facedesk>
So, I’ve been answering questions on StackOverflow for two days now, and I still like the experience. However, I have noticed a disturbing trend in several of the questions being asked that involve SQL Server. Here’s an example of one; I’ll give you the question, and my answer, and then tell you what’s bugging me.
TSQL [...]
October 8, 2009
Posted in: SQL, SQLServerPedia Syndication
3 Comments
Building ranges using numbers
A while back, I posted a solution to a problem I was facing where I needed to generate a table of ranges. While I haven’t experienced any sort of issues with the solution, a couple of things have recently occurred which has caused me to go back and take a look at the problem, and [...]
September 27, 2009
Posted in: SQL, SQL Server, SQLServerPedia Syndication
No Comments
FizzBuzz
Stumbled across Mike Hillwig’s post in response to a question posed by Brent Ozar. Depending on how literally you want to use the word “print” (do you mean the actual command, or do you just want output?), I think I have a slightly more elegant solution than what Mike proposed.
SELECT CASE WHEN n%3=0 AND n%5=0 [...]
September 27, 2009
Posted in: SQL, SQL Server, SQLServerPedia Syndication
No Comments
Fun with NEWSEQUENTIALID()
We’re thinking about converting the constrain on an existing column in a table with billions of rows of data. The column is a uniqueidentifier serving as a nonclustered primary key; we’re planning on replacing the NEWID() constraint to a NEWSEQUENTIALID(). What is challenging me is my concern over primary key collisions; will the new default [...]
July 31, 2009
Posted in: SQL, SQL Server, SQLServerPedia Syndication
One Comment
You CAN teach an old dog….
This is more of a sticky note kind of post, to remind me to use a better syntax in the future. Maybe it’ll help some of you as well.
A long time ago, when I was starting to write T-SQL, and I needed to extract only the date from a DATETIME column, I used to [...]
July 24, 2009
Posted in: SQL, SQLServerPedia Syndication
One Comment
Partitioning computed columns
For a project at work, I’ve been asked to help optimize our ETL process. Part of that involves taking an existing table, and partitioning it along two existing columns. Since the partitioning process only supports partitioning on one column, the obvious choice is to use a computed column. I ran into some issues along the [...]
July 22, 2009
Posted in: SQL, SQL Server, SQLServerPedia Syndication
No Comments
SCRUM, Source Control, and the SQL Server Developer (Part 2)
So my last post focused on the modifications my shop has made to our implementation of Scrum without a lot of details about how we manage our code changes. This post is intended to explain how we set up source control to support the scrum process.
Source control is one of those poorly-defined practices; it’s something [...]
May 20, 2009
Posted in: SQL, SQL Server, SQLServerPedia Syndication, VSTS:DB
No Comments



