select
replace(Street, char(10), '')
from streettable
Have explored the syntax of replace function ...but how does this piece of code work?
The sample code doesn't change datatype. char(10) is line feed and the code just replaces line feeds with empty symbol in street column(not in table, but on the fly to present. Data in table stays untouched).
If you want to change datatype then you should alter the column. Something like:
alter table streettable alter column Street varchar(777) null
CHAR(10)is not defining a type ofCHARwith a length of 10, is it the scalar functionCHAR()returning the ASCII character 10 (line feed).