Category: SQL Server

FluentNHibernate and SQL Date Generation

FluentNHibernate and SQL Date Generation

So you’d like your SQL entry to have a system generated date/time, eh? Here is a sample table:

To spare you hours dealing with this error:

What you need to do is to use the following mapping for...

SQL Query for Multi-Values In An Encoded String

SQL Query for Multi-Values In An Encoded String

Consider a table with an textual column that encodes multi-values like so:

How can we query for all rows using an OR criteria? For a single value, it’s quite easy by searching for the string (in this case, an...

FluentNHibernate vs. Code First in EF 4.1

FluentNHibernate vs. Code First in EF 4.1

First, having been in the SharePoint space exclusively for so long now, I have to admit: it’s been a while since I’ve had to deal with non-SharePoint data access.  I don’t know if I miss it or not 😀 I’ve...

T-SQL MERGE: My New Friend

T-SQL MERGE: My New Friend

As I was catching up on SQL 2008 this morning, I spent some time working with the T-SQL MERGE command, new in SQL 2008. Most of the blogs and examples online are a bit terse, so I decided to write...

FOR XML Needs More Love

FOR XML Needs More Love

I’m constantly amazed by the number of developers who have never worked with FOR XML EXPLICIT and the new FOR XML PATH.  If I were designing data access, it would be my go-to commands for building queries for complex data...

Dynamic SQL: Yea or Nay?

Dynamic SQL: Yea or Nay?

I’ve always been on the side of stored procedures in the classic debate over the merits of dynamic SQL.  In reality, I can only think of one good scenario where dynamic SQL at the application layer should be used: programmatic batch...

Working With SQL Server Compact Edition 2005

Working With SQL Server Compact Edition 2005

One interesting issue that I just solved involved how to specify the location of the database file for a SQL Server Compact Edition 2005 connection string in a .Net add-in for Microsoft Office. You see, when the add-in starts, it...

Updating Reporting Services 2000 Connection Info

Updating Reporting Services 2000 Connection Info

If you’re running Reporting Services 2000 and you accidentally change the password or remove the original account used by Reporting Services, you will have to update this information. With Reporting Services 2005, there’s a nice GUI utility that you can use to...

ContentTypeIds In WSS3

ContentTypeIds In WSS3

In WSS3, if you execute the following SQL:

You will notice that the content types are represented in the output as hex. If you take a look at the table definition, you’ll see that the actual data type of...

Fun in Philly

Wow, I had a lot more fun in Philly than I thought I would have. Back up a bit.  I had originally registered for the Microsoft launch event in Philly as a participant a few weeks back.  Last week, Rich,...