I have a table called notes with a column that is nvarchar(MAX), this columns may have 10 characters or it may have 800. I need to slice this up into 250 character segments.
If this line below was the value in the table I need to create 2 rows with a max of 250 characters. If you count characters you would split the word voicemail. I need to see it is in the middle of a word and not break it up.
Blanket Lien Filed, account returned to Provider. Blah Blah will continue to follow and pursue lien payment. Called Pt Blahat xxx-xxx-xxxx. Left voice mail. Voicemail greeting did not state a name. Called Pt at xxx-xxx-xxxx. Left voice mail. Voicemail greeting did not state a name.
I need it to look something like this and I have no idea to do this.
Row 1:
Blanket Lien Filed, account returned to Provider. Blah Blah will continue to follow and pursue lien payment. Called Pt Blahat xxx-xxx-xxxx. Left voice mail.
Row 2:
Voicemail greeting did not state a name. Called Pt at xxx-xxx-xxxx. Left voice mail. Voicemail greeting did not state a name.
I have tried this but it cuts the words off.
SELECT Acct, SUBSTRING(Notes, 1, 249) as Note, 'A1' AS Prefix
FROM dbo.[RegionalOneNotesResults]
UNION
SELECT Acct, SUBSTRING(Notes, 250, 249) as Note, 'B2' AS Prefix
FROM dbo.[RegionalOneNotesResults]
Any help would be appreciated