I have some data which looks like so:
SourceOfBooking
----------------
Company1 (Foo)
Company2 (Bar)
Company3 (Foo1)
Company4 (Foo2)
I am l
You cam simply try this.
Create a new table and insert the data as below scripts. Then execute the select query. You will get required output.
create table teststring
(name varchar(20))
insert into teststring values ('ashish (123)')
insert into teststring values ('ashish jain (123)')
select substring(name,1,charindex('(',name)-1)abc ,name from teststring