﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / T-SQL (SS2K5)  / T-SQL 2005 String Pattern?? / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 02:36:48 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: T-SQL 2005 String Pattern??</title><link>http://www.sqlservercentral.com/Forums/Topic632037-338-1.aspx</link><description>Part of my point here is to turn the OP to the direction of tally tables also.I purposely have asked him to look at them.Here is a simple way to create a Tally Table (Shamelessly copied from Jeff's article).[quote]--=============================================================================--      Create and populate a Tally table--=============================================================================--===== Conditionally drop and create the table/Primary Key     IF OBJECT_ID('dbo.Tally') IS NOT NULL         DROP TABLE dbo.Tally CREATE TABLE dbo.Tally         (N INT,          CONSTRAINT PK_Tally_N PRIMARY KEY CLUSTERED (N))--===== Create and preset a loop counterDECLARE @Counter INT    SET @Counter = 1--===== Populate the table using the loop and couner  WHILE @Counter &amp;lt;= 11000  BEGIN         INSERT INTO dbo.Tally                (N)         VALUES (@Counter)            SET @Counter = @Counter + 1    END[/quote][url=http://www.sqlservercentral.com/articles/TSQL/62867/]http://www.sqlservercentral.com/articles/TSQL/62867/[/url]</description><pubDate>Wed, 07 Jan 2009 19:18:13 GMT</pubDate><dc:creator>vick.ram79</dc:creator></item><item><title>RE: T-SQL 2005 String Pattern??</title><link>http://www.sqlservercentral.com/Forums/Topic632037-338-1.aspx</link><description>Thanks nil...prob solved!!</description><pubDate>Wed, 07 Jan 2009 19:12:12 GMT</pubDate><dc:creator>Superdec</dc:creator></item><item><title>RE: T-SQL 2005 String Pattern??</title><link>http://www.sqlservercentral.com/Forums/Topic632037-338-1.aspx</link><description>Try this one:Declare @str varchar(20),@i as intSet @str='HELLOW WORLD'Set @i=1While @i &amp;lt;= len(@str)Begin	print left(@str,@i)	Set @i=@i+1End</description><pubDate>Wed, 07 Jan 2009 19:09:13 GMT</pubDate><dc:creator>nil-364356</dc:creator></item><item><title>RE: T-SQL 2005 String Pattern??</title><link>http://www.sqlservercentral.com/Forums/Topic632037-338-1.aspx</link><description>declare  @str varchar(20)set  @str = 'HELLO WORLD'select  SUBSTRING(@str, 1,n)from  Tally twhere N&amp;lt;=LEN(@str)The 'Tally' table is simple table of numbers.... pls look for articles on Tally table here...My Tally Table has only a single column called N.</description><pubDate>Wed, 07 Jan 2009 18:58:44 GMT</pubDate><dc:creator>vick.ram79</dc:creator></item><item><title>T-SQL 2005 String Pattern??</title><link>http://www.sqlservercentral.com/Forums/Topic632037-338-1.aspx</link><description>How to PRINT below string pattern in T-SQL 2005:[b]Input:[/b]SET @str = 'HELLO WORLD'[b]Output:[/b]HHEHELHELLHELLOHELLO HELLO WHELLO WOHELLO WORHELLO WORLHWLLO WORLDThanks in advance.</description><pubDate>Wed, 07 Jan 2009 18:43:08 GMT</pubDate><dc:creator>Superdec</dc:creator></item></channel></rss>