Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 t-sql parse out data
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

332 Posts

Posted - 01/04/2013 :  14:17:56  Show Profile  Reply with Quote
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?

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 01/04/2013 :  14:28:03  Show Profile  Reply with Quote
if delimiters can be determined you can use logic like below

SQL Server MVP

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000