Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing list of keys to a sproc to get recordset
Message
De
30/09/2009 11:58:13
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Desktop
Divers
Thread ID:
01425870
Message ID:
01426919
Vues:
33
Yeah it would be fast if it worked:) Try Jeff Moden's code instead (I gave a link before).

>Hi Charles,
>
>Here is an interesting and fast variation of the split function
>
>CREATE FUNCTION  [dbo].[Split](
>    @List VARCHAR(8000),
>    @Del VARCHAR(1)
>) RETURNS TABLE
>AS
>RETURN (
>    WITH Tokens AS (
>        SELECT
>            StartPos = 1,
>            EndPos = CHARINDEX(@Del, @List COLLATE Latin1_General_BIN2 +@del)
>        UNION ALL
>        SELECT
>            EndPos + 1,
>            CHARINDEX(@Del, @List COLLATE Latin1_General_BIN2 + @del, EndPos + 1)
>        FROM Tokens
>        WHERE EndPos > 0
>    )
>    SELECT
>        SUBSTRING(@List, StartPos, EndPos - StartPos) as value
>    FROM Tokens
>    WHERE EndPos <> 0
>)    
>
>
>See http://forums.asp.net/p/1476140/3433391.aspx#3433391
>
>
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform