0
How can I extract values from varchar in SQL ? Ex 'San Jose, St Street, NY, 97'
I want to extract values from a varchar in sql ! Eg 'San Jose, St Street, NY, 97' the values are supposed to assigned in 3 parameters like @Name, @Address, @CodeNo
1 Answer
+ 1
You can extract and display the values separately using the SUBSTRING().
Select SUBSTRING(column_name,1,8) from table_name;
This would give you just the name 'San Jose'. You can similarly do it for the rest of the string. Also read about the substring() to get more clarity.