﻿<?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 2008 / T-SQL (SS2K8)  / t-sql parse out data / 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>Wed, 19 Jun 2013 07:49:20 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: t-sql parse out data</title><link>http://www.sqlservercentral.com/Forums/Topic1403060-392-1.aspx</link><description>Apparently Lowell was thinking of me for some reason (not sure why) when he posted so I couldn't help but chime in!You might want to take a look at the PatternSplitCM FUNCTION described in the 4th article in my signature link.  The article contains some examples of parsing out a filename from a string using that function.  It might help to get you started.</description><pubDate>Sun, 06 Jan 2013 18:33:20 GMT</pubDate><dc:creator>dwain.c</dc:creator></item><item><title>RE: t-sql parse out data</title><link>http://www.sqlservercentral.com/Forums/Topic1403060-392-1.aspx</link><description>wendy we need some examples, i think;splitting the name based on some character is easy; PARSENAME or the famous DelimitedSplit8K are two examples that come to mind;but unless there is a naming convention, ie the first x segments constitute the company name, i don't know what i can offer.[code]With MySampleData(filename)AS(SELECT 'wendy-elizabeth-inc-2013-01-04.txt' UNION ALLSELECT 'lowell_Corporation.txt' UNION ALLSELECT 'dwainc-LLC-LatestExport.txt')SELECT myfn.*,MySampleData.*FROM MySampleDataCROSS APPLY dbo.DelimitedSplit8K(REPLACE(filename,'_','-'),'-') myfn[/code]</description><pubDate>Fri, 04 Jan 2013 12:27:41 GMT</pubDate><dc:creator>Lowell</dc:creator></item><item><title>t-sql parse out data</title><link>http://www.sqlservercentral.com/Forums/Topic1403060-392-1.aspx</link><description>My goal is to parse out a company name and contact name  that is the actual filename of the excel spreadsheet. I will use this information in a sql server 2008 r2 database to obtain other related information for the company and contact person. My problem is the file name is manually keyed in my the user who runs the sql server 2008 r2 reports (ssrs) on the standard edition.  Is there away you would suggest that I try to parse out the  company and contact name from the file name? There are delimiters between the company and contact names how the delimiters may change.You assume that I will pass the filename to the t-sql. However I would like to know how you would setup the sql to accomodate the various in delimiters that may appear and the various of where the delimiters would appear at?Can you show me in code and/or point me to a reference on how to accomplish my goal?</description><pubDate>Fri, 04 Jan 2013 12:19:19 GMT</pubDate><dc:creator>wendy elizabeth</dc:creator></item></channel></rss>