SQL Server - Adding a string to a text column (concat equivalent)

后端 未结 6 1663
一整个雨季
一整个雨季 2021-02-03 20:21

How do you add a string to a column in SQL Server?

UPDATE [myTable] SET [myText]=\' \'+[myText]

That doesn\'t work:

The

6条回答
  •  庸人自扰
    2021-02-03 20:52

    hmm, try doing CAST(' ' AS TEXT) + [myText]

    Although, i am not completely sure how this will pan out.

    I also suggest against using the Text datatype, use varchar instead.

    If that doesn't work, try ' ' + CAST ([myText] AS VARCHAR(255))

提交回复
热议问题