Click here to monitor SSC

Andras Belokosztolszki


Andras Belokosztolszki

Why should I rebuild a table after dropping or adding a column?

4 comments

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

19 February 2009 2:30 am by
Andras Belokosztolszki

SQL Server 2008: Table-valued parameters

4 comments

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

27 August 2008 11:10 am by
Andras Belokosztolszki

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

2 comments

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

1 August 2008 5:02 am by
Andras Belokosztolszki

SQL Server 2008: new data types and .Net 2 with and without SP1

4 comments

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

20 June 2008 7:05 am by
Andras Belokosztolszki

SQL Server 2008: New languages and older operating systems

2 comments

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

21 April 2008 5:36 am by
Andras Belokosztolszki

SQL Compare 7 Beta and peeking into SQL Server backup files

2 comments

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

28 March 2008 4:51 am by
Andras Belokosztolszki

SQL Server 2008 CTP6 takes a day off

1 comment

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

29 February 2008 10:55 am by
Andras Belokosztolszki

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

2 comments

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

28 February 2008 3:34 am by
Andras Belokosztolszki

Can I redeclare a variable in T-SQL? Teaser for SQL Bits

2 comments

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

15 February 2008 7:17 am by
Andras Belokosztolszki

Some interesting, obscure (and absolutely useless) T-SQL syntax

3 comments

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

28 November 2007 4:05 am by
Older posts