- Local time
- Tomorrow, 04:37
- Joined
- Jan 20, 2009
- Messages
- 12,895
We upgraded our SQL server recently and today I found a feature we didn't have before that is making my life very easy.
STRING_SPLIT is does what it says with a nominated deliminator just like VBA Split() except it returns a table with a separate record for each item.Microsoft introduced it in Server 2016.
I was able to write a straightforward query that selected a record, returned a file stored as binary, converted it to text, split it into lines, selected the data lines from the page headers and footer, parsed the lines using a join to a table of parameters for SubString() then Pivot the results into columns.
It nearly instantly creates a recordset from the text. I previously did this task with a pile of VBA code in Access reading from files on the file system. That process took a whole lot longer.
STRING_SPLIT is does what it says with a nominated deliminator just like VBA Split() except it returns a table with a separate record for each item.Microsoft introduced it in Server 2016.
I was able to write a straightforward query that selected a record, returned a file stored as binary, converted it to text, split it into lines, selected the data lines from the page headers and footer, parsed the lines using a join to a table of parameters for SubString() then Pivot the results into columns.
It nearly instantly creates a recordset from the text. I previously did this task with a pile of VBA code in Access reading from files on the file system. That process took a whole lot longer.