Hi there,
Use this. Not sure if your TableName and ColumnName are both called Customer_Info
Code:
select PartId = case
When SUBSTRING(customer_info, charindex('PartId|',customer_info)+7, charindex('|CustomerId|',customer_info)-8) = '' Then NULL
Else SUBSTRING(customer_info, charindex('PartId|',customer_info)+7, charindex('|CustomerId|',customer_info)-8)
End
from dbo.customer_info
Cheers!
_________________________
- Vijay G
Strive for Perfection