Pinal Dave , in his site, posted a blog post about selecting domain name from the email address . He has used right function. Here is another method that will use STUFF function and does the same job. declare @t table(email varchar(100)) insert into @t select 'test@yahoo.com' union all select...
In this post Extract only numbers from a String , I described a method of extrating numbers from a string using split and concatenate technique In this post Regular expression , I described a method to extract whole numbers if a specific digit is found Consider that you have a situation where you need...
Now-a-days lot of questions are asked in the forum about extracting particular text from a string Here I give some examples on how to do it --Example 1 (Extracting tags and other informations) declare @s varchar(100) declare @temp table(id int identity(1,1),data varchar(100)) set @s='567 dataua testwelcome...
Sometimes when you import data from other system, you may need to clean the data by removing unwanted data. Consider you import data where you want to keep only those which are purely alphanumerals. Here is a way to find out declare @table table(data varchar(20)) Insert into @table select '23498'...