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
 General SQL Server Forums
 New to SQL Server Programming
 Partil Match and Update
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

aswindba1
Yak Posting Veteran

USA
62 Posts

Posted - 07/03/2013 :  13:52:53  Show Profile  Reply with Quote
I need update the AppID in table1 by comparing Table2. the data looks like below. Here the problem is AppNames in the both tables are not exactly same but technically they are same with partial match.

Table1

AppID||||Appname
Null ||||CSO Services Operations
Null |||| CSP
Null ||||AAC Claims Systems





Table 2

AppID|||||Appname
1 |||||Corporate Services Operations(CSO)
2 |||||Credit Servicing Portal(CSP)
3 |||||American Assuarance Company (AAC) Claims Systems


Please let me know how to get rid of this task.

thanks

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 07/03/2013 :  15:00:39  Show Profile  Reply with Quote
Best approach is to create a mapping table with Appnames from both tables as per your relationship (Only you knows which values correspond to what) then use a join to it as a bridge to connect the two above tables
Trying to match on pattern search may not work well seeing how values exists( there's no consistency in value formats etc) . If you really want to do it you may need to do string splitting etc.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
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.05 seconds. Powered By: Snitz Forums 2000