Nov 12: Quirks of LEN
As we all know, the LEN function in T-SQL returns the character length and at that ignores the trailing blanks... So, how to return the length including these trailing blanks? I experimented a little and found that all you have to do is CAST to the appropriate MAXed variant of your datatype. So just try the following:
DECLARE @l_nContentMax NVARCHAR(MAX)
, @l_nContent NVARCHAR(20)
SELECT @l_nContentMax = '1234567890 ' -- character length = 15
, @l_nContent = '1234567890 ' -- character length = 15
SELECT LEN(N'1234567890 ') AS Plain
, LEN(CAST(N'1234567890 ' AS NVARCHAR(MAX))) AS MaxCast
, LEN(@l_nContent) AS PlainVariable
, LEN(@l_nContentMax) AS MaxVariable
This results in:

So... just cast your expression to NVARCHAR(MAX) or VARCHAR(MAX) where appropriate and you'll get the right length
DECLARE @l_nContentMax NVARCHAR(MAX)
, @l_nContent NVARCHAR(20)
SELECT @l_nContentMax = '1234567890 ' -- character length = 15
, @l_nContent = '1234567890 ' -- character length = 15
SELECT LEN(N'1234567890 ') AS Plain
, LEN(CAST(N'1234567890 ' AS NVARCHAR(MAX))) AS MaxCast
, LEN(@l_nContent) AS PlainVariable
, LEN(@l_nContentMax) AS MaxVariable

So... just cast your expression to NVARCHAR(MAX) or VARCHAR(MAX) where appropriate and you'll get the right length
Jun 18: TF31002
Unable to connect to this Team Foundation Server...
Microsoft Visual Studio 2005 pops up a nice dialog with three possible reasons for failure:

Well, apparently the appSettings node must be located below the configSections node. If not, all kind of strange things (like not being able to connect to TFS) will occur.
Microsoft Visual Studio 2005 pops up a nice dialog with three possible reasons for failure:
- The Team Foundation Server name, port number or protocol is incorrect.
- The Team Foundation Server is offline.
- Password is expired or incorrect.
Well, apparently the appSettings node must be located below the configSections node. If not, all kind of strange things (like not being able to connect to TFS) will occur.
Feb 23: BIOS IDE Detection Hell
OK, I admit... It's been a while since I put together a PC. But this is really too weird. At startup, even before having an OS installed, there was a tremendous delay when the BIOS tried to detect the IDE devices. Just two, a hard disk drive on the primary and a CDROM on the secondary. How hard can that be to detect?
Well appearently very hard, because the waiting started to bother me from the first boot I had to make. So you start tweaking the BIOS settings. The BIOS Optimization Guide seemed a good place to start. But allas, whatever I tried it was of no use.
Hours later, after searching the web for known issues with my drives and/or mobo, I finally keyed the right phrase into google and asked 'slow boot in bios'. And there my answer was, only one click and some scrolling away. Googles first result, opened a discussion thread called 'Slow Booting' and hidden under 'Response Number 6' I found what I was looking for.
Hold on: the jumpers on the IDE devices need to be set to cable select. The setting master is not good enough anymore. Why, why, WHY!?
Well appearently very hard, because the waiting started to bother me from the first boot I had to make. So you start tweaking the BIOS settings. The BIOS Optimization Guide seemed a good place to start. But allas, whatever I tried it was of no use.
Hours later, after searching the web for known issues with my drives and/or mobo, I finally keyed the right phrase into google and asked 'slow boot in bios'. And there my answer was, only one click and some scrolling away. Googles first result, opened a discussion thread called 'Slow Booting' and hidden under 'Response Number 6' I found what I was looking for.
Hold on: the jumpers on the IDE devices need to be set to cable select. The setting master is not good enough anymore. Why, why, WHY!?
« previous page
(Page 3 of 5, totaling 14 entries)
next page »
