Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing list of keys to a sproc to get recordset
Message
From
30/09/2009 11:58:13
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Desktop
Miscellaneous
Thread ID:
01425870
Message ID:
01426919
Views:
34
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform