﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Alex Grinberg / Article Discussions / Article Discussions by Author </title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 24 May 2012 12:24:40 GMT</lastBuildDate><ttl>20</ttl><item><title>The Multi-valued Parameters problem in Reporting Services</title><link>http://www.sqlservercentral.com/Forums/Topic701184-229-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Reporting+Services/66322/"&gt;The Multi-valued Parameters problem in Reporting Services&lt;/A&gt;[/B]</description><pubDate>Tue, 21 Apr 2009 00:15:42 GMT</pubDate><dc:creator>Alex Grinberg-230981</dc:creator></item><item><title>Creating Functions for Stored Procedures</title><link>http://www.sqlservercentral.com/Forums/Topic583773-229-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/T-SQL/64352/"&gt;Creating Functions for Stored Procedures&lt;/A&gt;[/B]</description><pubDate>Fri, 10 Oct 2008 00:21:07 GMT</pubDate><dc:creator>Alex Grinberg-230981</dc:creator></item><item><title>SqlServer 2000</title><link>http://www.sqlservercentral.com/Forums/Topic497031-229-1.aspx</link><description>how to declare array in sqlServer 2000 and we get the value of that arrayany one can help me?</description><pubDate>Thu, 08 May 2008 06:01:26 GMT</pubDate><dc:creator>acekn</dc:creator></item><item><title>The ARRAY In SQL Server 2000</title><link>http://www.sqlservercentral.com/Forums/Topic180627-229-1.aspx</link><description>Comments posted to this topic are about the content posted at &lt;A HREF="http://www.sqlservercentral.com/columnists/aGrinberg/thearrayinsqlserver2000.asp"&gt;http://www.sqlservercentral.com/columnists/aGrinberg/thearrayinsqlserver2000.asp&lt;/A&gt;</description><pubDate>Fri, 06 May 2005 11:45:00 GMT</pubDate><dc:creator>Alex Grinberg-230981</dc:creator></item><item><title>Raid Array Design for Multiple Instances of Databases</title><link>http://www.sqlservercentral.com/Forums/Topic456607-229-1.aspx</link><description>We are having multiple instances of single database &amp; single cpu with 3.00 ghz &amp; ram with 4 gb but still the users are facing poor performance in accessing the applicaton, ultimately slow performance.CPU SPIKES ARE GOING VERY HIGH &amp; RAM AVAILABLE IS 1 GB.HDD IS 146 * 5 .Please guide us on this topic how to design RAID  for 29 intances of database. Is there anybody who can focus on it ?[/font]Vrijesh Prajapati</description><pubDate>Sat, 16 Feb 2008 01:05:17 GMT</pubDate><dc:creator>vrijesh prajapati</dc:creator></item><item><title>Arrays in SQL SERVER</title><link>http://www.sqlservercentral.com/Forums/Topic421458-229-1.aspx</link><description>can we able to use arrays in sql server 2000 or any other option similar to array? if any provide the solution..</description><pubDate>Tue, 13 Nov 2007 04:34:56 GMT</pubDate><dc:creator>Ananth-431739</dc:creator></item><item><title>Working With System Tables</title><link>http://www.sqlservercentral.com/Forums/Topic245397-229-1.aspx</link><description>Comments posted to this topic are about the content posted at &lt;A HREF="http://www.sqlservercentral.com/columnists/aGrinberg/workingwithsystemtables.asp"&gt;http://www.sqlservercentral.com/columnists/aGrinberg/workingwithsystemtables.asp&lt;/A&gt;</description><pubDate>Mon, 19 Dec 2005 17:01:00 GMT</pubDate><dc:creator>Alex Grinberg-230981</dc:creator></item><item><title>Self Eliminated Parameters</title><link>http://www.sqlservercentral.com/Forums/Topic312755-229-1.aspx</link><description>Comments posted here are about the content posted at &lt;A HREF="temp"&gt;temp&lt;/A&gt;</description><pubDate>Mon, 02 Oct 2006 14:29:00 GMT</pubDate><dc:creator>Alex Grinberg-230981</dc:creator></item><item><title>RE:</title><link>http://www.sqlservercentral.com/Forums/Topic252294-229-1.aspx</link><description>&lt;P&gt;The array function was the first thing that I always had needed and missed not having in SQL 2000.  Unfortunatly as time does not permit me, I am probably the only one here who hasn't yet had the chance to explore 2005 so if what I'm posting here is now superseeded, I do apologize.  However, I'm sure it will come in handy to some.  &lt;/P&gt;&lt;P&gt;In my programming, there are many cases where I need to generate an array on the fly from a text string input.  In asp, I'm able to do this by calling String("Some,String").split(",") but SQL also lacks this capability.&lt;/P&gt;&lt;P&gt;Through the use of UDFs I am able to simulate this functionality and make the full use of a psuedo array.  I have included both a single array and a dual array.  The dual array is very useful when you wish to submit a string of variables and their values to SQL either for storage and/or processing, such as "Item1=Value1&amp;amp;Item2=Value2"&lt;/P&gt;&lt;P&gt;I hope that this may prove useful to someone else out there and I thank all the authors who have made my life easier thanks to the posts/articles here!&lt;/P&gt;&lt;P&gt;-Anubis.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Usage:&lt;/P&gt;&lt;P&gt;SELECT ArrayItemFROM [dbo].[Scripts_CreateArray]('Input,String,Here', ',')&lt;/P&gt;&lt;P&gt;Function:&lt;/P&gt;&lt;P&gt;CREATE FUNCTION [dbo].[Scripts_CreateArray]&lt;/P&gt;&lt;P&gt; ( @ItemInput [varchar] (8000), @ItemBreaker [varchar] (5)&amp;nbsp&lt;img src='images/emotions/wink.gif' height='20' width='20' border='0' title='Wink' align='absmiddle'&gt;  &lt;/P&gt;&lt;P&gt;RETURNS @ArrayTable TABLE  ( ArrayItem [varchar] (200)-- (if collation required) COLLATE SQL_Latin1_General_CP1_CI_AS&amp;nbsp&lt;img src='images/emotions/wink.gif' height='20' width='20' border='0' title='Wink' align='absmiddle'&gt;&lt;/P&gt;&lt;P&gt;AS  &lt;/P&gt;&lt;P&gt;BEGIN &lt;/P&gt;&lt;P&gt;-- DECLARE WORKING VARIABLESDECLARE @BreakerPosition [int], @BreakerLength  [tinyint], @LoopCounter  [int], @LoopCounterMax  [int]&lt;/P&gt;&lt;P&gt;SET @LoopCounter = 0SET @LoopCounterMax = LEN(@ItemInput)SET @BreakerLength = LEN(@ItemBreaker)&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;-- BEGIN LOOP FOR ARRAY ITEMSWHILE (@LoopCounter &amp;lt; @LoopCounterMax AND LEN(@ItemInput) &amp;gt; 0)  BEGIN&lt;/P&gt;&lt;P&gt;    -- GET BREAKER POSITION    SET @BreakerPosition = CHARINDEX(@ItemBreaker, @ItemInput)    IF (@BreakerPosition = 0)      BEGIN        SET @BreakerPosition = LEN(@ItemInput) + @BreakerLength      END&lt;/P&gt;&lt;P&gt;    -- INSERT INTO TEMP TABLE    INSERT INTO @ArrayTable ( ArrayItem&amp;nbsp&lt;img src='images/emotions/wink.gif' height='20' width='20' border='0' title='Wink' align='absmiddle'&gt;&lt;/P&gt;&lt;P&gt;    VALUES ( SUBSTRING(@ItemInput, 1, (@BreakerPosition - 1))&amp;nbsp&lt;img src='images/emotions/wink.gif' height='20' width='20' border='0' title='Wink' align='absmiddle'&gt;  &lt;/P&gt;&lt;P&gt;    -- UPDATE LENGTHS AND POSITIONS    SET @ItemInput = SUBSTRING(@ItemInput, (@BreakerPosition + @BreakerLength), LEN(@ItemInput))    SET @LoopCounter = @LoopCounter + 1&lt;/P&gt;&lt;P&gt;  END&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;-- RETURN ARRAYRETURN&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Usage:&lt;/P&gt;&lt;P&gt;SELECT ArrayItem, ArrayItem2FROM [dbo].[Scripts_CreateArray_Dual]('Input=Item,String=Here', '=', ',')&lt;/P&gt;&lt;P&gt;Function:&lt;/P&gt;&lt;P&gt;CREATE FUNCTION [dbo].[Scripts_CreateArray_Dual]&lt;/P&gt;&lt;P&gt; ( @ItemInput [varchar] (8000), @ItemBreaker [varchar] (5), @ItemBreaker2 [varchar] (5)&amp;nbsp&lt;img src='images/emotions/wink.gif' height='20' width='20' border='0' title='Wink' align='absmiddle'&gt;  &lt;/P&gt;&lt;P&gt;RETURNS @ArrayTable TABLE  ( ArrayItem [varchar](4000),-- COLLATE SQL_Latin1_General_CP1_CI_AS, ArrayItem2 [varchar](4000)-- COLLATE SQL_Latin1_General_CP1_CI_AS&amp;nbsp&lt;img src='images/emotions/wink.gif' height='20' width='20' border='0' title='Wink' align='absmiddle'&gt;&lt;/P&gt;&lt;P&gt;AS  &lt;/P&gt;&lt;P&gt;BEGIN &lt;/P&gt;&lt;P&gt;-- DECLARE WORKING VARIABLESDECLARE @BreakerPosition [int], @BreakerLength  [tinyint], @BreakerLength2  [tinyint], @LoopCounter  [int], @LoopCounterMax  [int], @Item1   [varchar](4000), @Item2   [varchar](4000)&lt;/P&gt;&lt;P&gt;SET @LoopCounter = 0SET @LoopCounterMax = LEN(@ItemInput)SET @BreakerLength = LEN(@ItemBreaker)SET @BreakerLength2 = LEN(@ItemBreaker2)&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;-- BEGIN LOOP FOR ARRAY ITEMSWHILE (@LoopCounter &amp;lt; @LoopCounterMax AND LEN(@ItemInput) &amp;gt; 0)  BEGIN&lt;/P&gt;&lt;P&gt;    -- GET BREAKER POSITION    SET @BreakerPosition = CHARINDEX(@ItemBreaker, @ItemInput)    IF (@BreakerPosition = 0)      BEGIN        SET @BreakerPosition = LEN(@ItemInput) + @BreakerLength      END&lt;/P&gt;&lt;P&gt;    -- GET ITEM 1    SET @Item1 = SUBSTRING(@ItemInput, 1, (@BreakerPosition - 1))      -- UPDATE LENGTHS AND POSITIONS    SET @ItemInput = SUBSTRING(@ItemInput, (@BreakerPosition + @BreakerLength), LEN(@ItemInput))    SET @LoopCounter = @LoopCounter + 1&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    -- GET BREAKER POSITION    SET @BreakerPosition = CHARINDEX(@ItemBreaker2, @ItemInput)    IF (@BreakerPosition = 0)      BEGIN        SET @BreakerPosition = LEN(@ItemInput) + @BreakerLength      END&lt;/P&gt;&lt;P&gt;    -- GET ITEM 2    SET @Item2 = SUBSTRING(@ItemInput, 1, (@BreakerPosition - 1))      -- UPDATE LENGTHS AND POSITIONS    SET @ItemInput = SUBSTRING(@ItemInput, (@BreakerPosition + @BreakerLength2), LEN(@ItemInput))    SET @LoopCounter = @LoopCounter + 1&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    -- INSERT INTO TEMP TABLE    INSERT INTO @ArrayTable ( ArrayItem, ArrayItem2&amp;nbsp&lt;img src='images/emotions/wink.gif' height='20' width='20' border='0' title='Wink' align='absmiddle'&gt;&lt;/P&gt;&lt;P&gt;    VALUES ( @Item1, @Item2&amp;nbsp&lt;img src='images/emotions/wink.gif' height='20' width='20' border='0' title='Wink' align='absmiddle'&gt;&lt;/P&gt;&lt;P&gt;  END&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;-- RETURN ARRAYRETURN&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description><pubDate>Fri, 20 Jan 2006 05:18:00 GMT</pubDate><dc:creator>Anubis-237029</dc:creator></item></channel></rss>
