Struggling with this one.
I have a table called requeststext, the 2 columns of interest here are;
- 'Title' (nvarchar(255), not null)
- 'Description' (ntext, null)
I would like to update multiple rows, setting each row's 'Title' to be specific text from their 'Description' field.
Example;
Title is always;
New incident has been raised
Description is a very large string of data and it also contains line breaks, an example extract would be;
How it appears in SSMS*;
This Request has been raised:<CRLF>==================================================[CRLF]Request 123456: My PC doesn't work - please help![CRLF]==================================================[CRLF]Type: Incident[CRLF]...
How it appears in the application (easier to read);
This Request has been raised:
==================================================
Request 123456: My PC doesn't work - please help!
==================================================
Type: Incident
...
Things to note about description;
- * I added in the [CRLF]'s as these don't appear in SSMS
- The text/characters within the field remain in the same positions, the only varying part is the 'My PC doesn't work - please help!' part, this could be varying in text and length.
The desired result would be Title being changed to:
"My PC doesn't work - please help!"
I have been trying to get PATINDEX to work with SUBSTRING but I just can't seem to get it to work.