SQL Server UPPERCASE for all data for all columns in the table

后端 未结 2 1468
忘了有多久
忘了有多久 2021-01-24 13:58

I would like to know how to convert all data to UPPERCASE for all columns name and the values in them for a table. The data may contain int but it will ignore it. S

2条回答
  •  终归单人心
    2021-01-24 14:50

    Unfortunately, you can't to that directly. You need to specify each column names that need to be updated. eg

    UPDATE tablename
    SET    col = UPPER(col)
           colN = UPPER(colN)
    

    But, it's not the end of the world. You can still do that but with Dynamic SQL.

提交回复
热议问题