Andras Belokosztolszki

The amount of space used by table rows can be important, and there are good articles on the web that show ways to estimate the amount of space that a table row uses. However, the actual space used by a table row could be more than what we would have calculated. The problems come when […]

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 […]

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 = folder.GetFiles(“*.foobar”, […]

SQL Server 2008 has introduced a few new data types, among others the new date types, like date, time, datatime2 and datetimespan. Because .Net 2 was released before SQL Server 2008 has introduced these data types, there are no classes that map to these new types in .Net 2. But this has changed with .Net […]

SQL Server 2008 introduces a few new languages like Welsh, Tibetan and Norwegian. While these new languages map to the codepages in Windows Server 2008, in earlier operating systems (like XP) this is not so, and simple queries like “select * from mytable” can break with the SQL error 4078. The problem occurs if you […]

I want to restore only a single table from my database backup. We have been hearing this request from many of our SQL Backup customers. The problem is simple: Given a large database backup and a live database that has a partial “corruption”, e.g. the data in a single table has been accidentally modified and […]

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 […]

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 […]

Variables in T-SQL behave differently from what people may be used to in languages like C or C#. The scope of a variable is the batch in which it is declared. This may not be intuitive to people who are used to local variables. So let’s look at an interesting example: DECLARE @counter INT […]

/*Writing ugly SQL Statements is an art. Today I’ve spenta few minutes trying to break our parser as well as giving a grill to SQL Server’s parser.So here is some extra syntax that is not behaving as I’d expect it to behave. */select 1.a– Yes, this is legal, surprise surprise it returns a – table […]