Home Forums SQL Server 2005 T-SQL (SS2K5) split column into multiple records based on substring fixed lenght RE: split column into multiple records based on substring fixed lenght

  • All the "SELECT 1 UNION ALL" create 10 rows which I later use to create 100 rows with a CROSS JOIN in the next CTE.

    I'm using TOP 50 because you said that you have a varchar(4000) and 4000/80 = 50.

    You can change the value to any value you need or just remove it.

    To put your code in the code box you use the IFCode Shortcuts. Either you click on the [ code="sql"] one before inserting the code and then put the code between the labels or you can select the code and click on the shortcut to put the labels around your selection.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2