• the end goal here is a Split function, which will split a string into fields based on specifying the delimiter. This is for the ETL development I do, which takes various types of delimited data and put it into the necessary DB/table. While most data has a more common delimiter, such as a comma or pipe, sometimes is it a space, so I want my Split function to handle the space, if that's what's required. The function works fine for other delimiters, and I can also specify a byte count, such as 5, and it will split the data every 5 bytes and return it in a Table.

    When I pass it a space as a delimiter I get nothing back, and while troubleshooting this I found how TSQL evaluates a space, as in:

    If @Delimiter <> ''

    And unfortunately that is evaluated as False, so the function doesn't return data.

    That part is done to see if I have been passed a delimiter or a byte count to split on. The delimiter trumps a byte count, of both are specified.

    Thanks,

    Chris

    Learning something new on every visit to SSC. Hoping to pass it on to someone else.