-2

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

HoursSpent
8.3
1.55
2.6
7.2
Squirrel
  • 23,507
  • 4
  • 34
  • 32
Duvan_K
  • 3
  • 2

1 Answers1

1

You use UPDATE to make changes:

UPDATE table SET HoursSpent=REPLACE(HoursSpent,',','.');
Tim Roberts
  • 48,973
  • 4
  • 21
  • 30