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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Remove value from middle of string

Author  Topic 

mxfrail
Yak Posting Veteran

84 Posts

Posted - 2012-12-08 : 07:24:25
Hi,

Could I get help with the following so I can avoid creating multiple concat with left and right to do the following -

To perform successful join I need remove a value from the middle of my production file.

Product_Code
634020030410 – Load file
63402030410 - Production

I wanted to avoid -

left(product_code,6)
right(product_code,5)

To make -

concat(left(product_code,6),right(product_code,5))

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-12-08 : 08:27:25
Perhaps this?
STUFF(product_code,7,LEN(product_code)-11,'')
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2012-12-24 : 06:47:01
What is middle string? It may vary based on data length

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -