尝试这样的事情。可能是您可以创建以下实现的SQL函数。
DECLARE @Str VARCHAr(1000)SET @Str = '2012-04-24 Change request #3 for the contract per terms and conditions and per John Smith in the PSO department Customer states terms should be Net 60 not Net 30. Please review signed contract for this information.'DECLARE @End INTDECLARE @Split INTSET @Split = 100declare @Sometable table( Content varchar(3000))WHILE (LEN(@Str) > 0)BEGIN IF (LEN(@Str) > @Split) BEGIN SET @End = LEN(LEFt(@Str, @Split)) - CHARINDEX(' ', REVERSe(LEFt(@Str, @Split))) INSERT INTO @Sometable VALUES (RTRIm(LTRIm(LEFt(LEFt(@Str, @Split), @End)))) SET @Str = SUBSTRINg(@Str, @End + 1, LEN(@Str)) END ELSE BEGIN INSERT INTO @Sometable VALUES (RTRIm(LTRIm(@Str))) SET @Str = '' ENDENDSELECt *FROM @Sometable输出将是这样的:
2012-04-24 Change request #3 for the contract per terms and conditions and per John Smith in thePSO department Customer states terms should be Net 60 not Net 30. Please review signed contractfor this information.



