Archive for September, 2008

The worst day-to-day part of adulthood

Tuesday, September 16th, 2008

The worst day-to-day part of adulthood has to be the morning commute. I prefer taking the train; but, I regularly have to drive. It’s humiliating: being up early, driving out of town to a boring suburb, being so tiered of all the morning talk and commercials that I leave the radio on the only station playing music. Listening to Right Said Fred before 9am.

use replace() with an ntext value

Tuesday, September 16th, 2008

ntext is a text image. In other words, the text itself is stored in a separate location from the datatable. What is in the datatable is a pointer to where the text is stored. Because of this use can’t use too many functions on an ntext value. Changing the datatype to nvarchar in the design view may not help. The way I have been working around this is to take the individual row/column value and convert that to nvarchar(max)

select cast(replace(cast(myntext as nvarchar(max)),‘find’,‘replace’) as ntext)
from myntexttable

This was taken from http://www.sidesofmarch.com/index.php/archive/2008/02/27/how-to-use-replace-within-ntext-columns-in-sql-server/