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, '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;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, '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;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, '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) , | |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// Example from Entity Framework Extensions Library | |
// BulkInsert extension methods added automatically | |
using (var ctx = new EntitiesContext()) | |
{ | |
// Do not use the ChangeTracker or require to add the list in the DbSet | |
ctx.BulkInsert(list); | |
} |
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 FUNCTION [dbo].[fn_Split]( | |
@sInputList VARCHAR(8000), | |
@sDelimiter VARCHAR(8000) = ',' | |
) | |
RETURNS @List TABLE ( item VARCHAR(8000) ) | |
BEGIN | |
DECLARE @sItem VARCHAR(8000) | |
WHILE CHARINDEX(@sDelimiter, @sInputList, 0) <> 0 | |
BEGIN |