Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Replacing a comma (,) with a dot (.)

I am using SSMS, beginner in SQL
I want to replace varchar values which contains commas, to dots to parse through on other software which reads dots as floating values
But from what I gathered, the Replace only works in a select and does not do it permanently.
I want to see that 22 rows affected where commas was replaced

Example of data

HoursSpent
8,3
1,55
2,6
7,2

Example of end result

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

HoursSpent
8.3
1.55
2.6
7.2

>Solution :

You use UPDATE to make changes:

UPDATE table SET HoursSpent=REPLACE(HoursSpent,',','.');
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading