SQL 2008 in Q3 ’08

January 25, 2008

Teo Lachev has brought up that a clarification has been made that SQL 2008 will be released in Q3 2008.  The original blog entry can be found here.

I guess this is good news – but I have to say that many of the places I’m working are just getting through the 2000 to 2005 migration.  I know that Microsoft has been hard at work to deliver SQL within the 24-36 month range.  I have to ask myself – is that because they think it is good for their customers or because it is good for their revenue stream?

Can customers keep up with the upgrade cycle? Can technologists keep up with all the new features?

I also think that Microsoft is undermining their certifications program because it is quite an investment to achieve one and before you know it, you have to start all over with the next version.

Have a good weekend.


Carriage Return in T-SQL varchar

January 23, 2008

This turned out to be a dumb question – or rather it had a simple answer.  I wanted to insert a carriage return and line feed into a sql statement I was generating in T-SQL so that it was more readable.  My first question was which comes first, the chicken or the egg?  Just kidding – actually the question was, which comes first char(13) or char(10)?  Turns out, seems like char(13) comes first.  I’ve always been inside a programming language so you could use things like Environment.NewLine – so I hadn’t ever memorized it.  First question answered.

The second question was about actually getting the carriage return to show up in the text.  Turns out that you can’t put (or I couldn’t figure out a way) a carriage return into a statment that is SELECTed.  Rather you need to use the PRINT statment and then you’ll be good to go.

I never found anyone that really stated that you can’t do it in a SELECT and to do it in a PRINT.  So – I thought I’d just get it written down here – if not for my reference later!

Have a good day!

Mark


Null inside a Script Component

January 9, 2008

Hope everyone had a good holiday season.  I did.

Something I’m dealing with today has me stumped.  I searched google (ahem – live search) to see if there was any information out there and I didn’t find anything.

I have a script componenet that I’m using as a transformation and I’m adding a colunm to the data flow inside of it and the new column is an integer (DT_I4).  Inside the script I’m testing to see if a varchar field has a number in it (hence why I’m using a script component – there is no IsNumeric() in SSIS) and setting it to NULL if the incoming data isn’t a number.

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)Dim Result As Int32
   If System.Int32.TryParse(Row.VarcharColumn, Result) Then
      Row.IntegerColumn = Result
   Else
      Row.IntegerColumn = vbNull
   End If
End Sub

So here is the deal.  When I set the IntegerColumn = vbNull, it comes out in the data flow as 1.  If I set it = to Nothing, it comes out in the data flow as 0Does anyone know how to set an integer in the data flow = NULL inside a script transformation taskBy the way – the work around I came up with was to set the integer column = 98989898 ( or some other rediculous integer) and then use a derived column task to transform that back to null in the next step of the data flow.Anyone have thoughts?

Mark

UPDATE: A colleague of mine, Yuri Bykov, has come up with an answer.  Check the comment below.  Thanks, Yuri!