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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Partil Match and Update

Author  Topic 

aswindba1
Yak Posting Veteran

62 Posts

Posted - 2013-07-03 : 13:52:53
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

52326 Posts

Posted - 2013-07-03 : 15:00:39
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
   

- Advertisement -