3

I have a table (SQL Sever) with some values in it (Column name path), but now I want to update each row with a specific letter say x.

In the path column, I have many records and I need to change whatever the value in the path column with x, if a row is of 5 then the column will be replaced by xxxxx, if column is of length 9 then xxxxxxxxx to get in that place. And I need to change in every record.

How can I do this simply?

1 Answer 1

5
update tablename
set path = REPLICATE('x', len(path))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.