SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

jassie
Constraint Violating Yak Guru

308 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?

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

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

http://visakhm.blogspot.in/2010/02/parsing-delimited-string.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.08 seconds. Powered By: Snitz Forums 2000