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)
 Substring ??

Author  Topic 

nayanancha
Starting Member

27 Posts

Posted - 2012-03-07 : 17:27:54
I have a string which always start with 'Company.' I want to get the remaining sting after that initial one.

Company.XXX
Company.YYY

I want the substring for the above ones as 'XXX' and 'YYY'.

Thanks

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-03-07 : 17:41:22
SELECT STUFF(myString,1,LEN('Company.'),'')
FROM myTable
WHERE myString LIKE 'Company.%'
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-07 : 19:53:20
REPLACE(string,'Company.','')

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

Go to Top of Page
   

- Advertisement -