var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: split text field in SQL SErver 2008
In SQL SErver 2008, I have a text column. I need to display either 2nd word in the text column or 1st word in the text column based on certain conditions.
How shall i display either 2nd word or 1st word from a text field.
I'm going to assume you mean a varchar field and if so this should get you started
^ UNTESTED CODE ^
, CharIndex(' ', your_field) As first_space
, CharIndex(' ', your_field, CharIndex(' ', your_field) + 1) As second_space
Have a sit and think about how this can help you, remembering that you might not always have a first, or even second space to search upon.
Clues: Coalesce(), Len(), SubString()