SQL Server 2008: Table-valued parameters

Table-valued types and parameters are among the many exciting new features of the recently released SQL Server 2008. These table-valued types allow you to pass table data to stored procedures and functions. But why is this useful? In previous versions of SQL Server one could pass parameters to stored procedures and functions. A single parameter … Read more

The unexpected behaviour of DirectoryInfo.GetFiles() with three letter extensions

There is a documented, but certainly counterintuitive issue with the DirectoryInfo.GetFiles() method in .Net. This method returns a list of files that match a particular pattern. For example in the following example it will return us all the files on drive Z: that have the exact extension “.foobar” DirectoryInfo folder = new DirectoryInfo(@”z:”); FileInfo[] files … Read more

SQL Server 2008 CTP6 takes a day off

SQL Server 2008 CTP6 does not work on February 29th. Period. On one hand, it is really nice that Microsoft is releasing Community Technology Previews for its latest SQL Server. It helps developers and DBAs to test their solutions and get familiar with the next version of SQL Server. On the other hand, since Microsoft … Read more

Type less in SQL Server 2008 (variable initialization and multiple row inserts)

Among the large number of new features in SQL Server 2008 there are two, almost insignificant features, that I use almost constantly. These are variable initialization and the values clause of insert statements that now accept multiple rows. When playing with SQL one inevitably declares some variables. After the declaration, and as per the SQL … Read more

The GO command can have a parameter?

I have mixed feelings about the GO command. It is not a T-SQL statement, it is just something that Management Studio and the other SQL Server tools understand as a batch separator command. Indeed, you can change it to whatever you wish in Management Studio under Tools->Options->Query Execution->SQL Server->General->Batch separator.So you can write queries like … Read more

Databases and source control article

My current interest is focused on database evolution and on ways to manage changes to database schemata. This interest is reflected in my current project, SQL Compare 6. This version has the goal to help source control integration for databases by allowing users to handle a set of SQL creation scripts as a possible source … Read more