This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CREATE test | |
DECLARE @t TABLE (Id INT , Input VARCHAR(MAX)) | |
INSERT INTO @t VALUES ( 1, '1, 2, 3; 4; 5' ), ( 2, '6;7,8;9,10' ) | |
-- SPLIT with many delimiters: ',' and ';' | |
DECLARE @sqlnet SQLNET = SQLNET::New('Regex.Split(input, ",|;")') | |
SELECT * | |
FROM @t AS A | |
CROSS APPLY ( SELECT * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CREATE test table | |
DECLARE @SourceTable TABLE | |
( | |
RowID INT , | |
DelimitedString VARCHAR(8000) , | |
ArrayIndex INT | |
) | |
INSERT INTO @SourceTable | |
VALUES ( 1, 'a;b;c;d;e', 0 ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CREATE test table | |
DECLARE @SourceTable TABLE | |
( | |
RowID INT , | |
DelimitedString VARCHAR(8000) | |
) | |
INSERT INTO @SourceTable | |
VALUES ( 1, '1;2;3;4;5' ), | |
( 2, '2;4;6;8' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CREATE test table | |
DECLARE @SourceTable TABLE | |
( | |
RowID INT , | |
DelimitedString VARCHAR(8000) | |
) | |
INSERT INTO @SourceTable | |
VALUES ( 1, 'a;b' ), | |
( 2, 'a;b;c' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CREATE test table | |
DECLARE @SourceTable TABLE | |
( | |
RowID INT , | |
DelimitedString VARCHAR(8000) | |
) | |
INSERT INTO @SourceTable | |
VALUES ( 1, 'b;a' ), | |
( 2, 'c;a;b' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CREATE test table | |
DECLARE @SourceTable TABLE | |
( | |
RowID INT , | |
DelimitedString VARCHAR(8000) | |
) | |
INSERT INTO @SourceTable | |
VALUES ( 1, 'a;a;b' ), | |
( 2, 'a;b;c;b;b;a;c;a' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CREATE test table | |
DECLARE @SourceTable TABLE | |
( | |
RowID INT , | |
DelimitedString VARCHAR(8000) | |
) | |
INSERT INTO @SourceTable | |
VALUES ( 1, '1;2' ), | |
( 2, '1;3;5' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CREATE test table | |
DECLARE @SourceTable TABLE | |
( | |
RowID INT , | |
DelimitedString VARCHAR(8000) | |
) | |
INSERT INTO @SourceTable | |
VALUES ( 1, 'a;b' ), | |
( 2, 'a;b;c' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CREATE test table | |
DECLARE @SourceTable TABLE | |
( | |
RowID INT , | |
DelimitedString VARCHAR(8000) | |
) | |
INSERT INTO @SourceTable | |
VALUES ( 1, 'a;a;b' ), | |
( 2, 'c;b;c;b;b;a;c;a' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |