我在 SQL Server 2014 上,我需要从列内容的开头和结尾清除空格,其中空格可以是简单的空格、制表符或换行符(\n
和\r\n
);例如
' this content ' should become 'this content'
' \r\n \t\t\t this \r\n content \t \r\n ' should become 'this \r\n content'
Run Code Online (Sandbox Code Playgroud)
等等。
我只能实现第一个案例
UPDATE table t SET t.column = LTRIM(RTRIM(t.column))
Run Code Online (Sandbox Code Playgroud)
但对于其他情况,它不起作用。
我在 SQL Server 2014 上,我有一张User
表:
+----+------+-----+
| ID | Name | ... |
+----+------+-----+
| 11 | John | ... |
| 12 | Jack | ... |
| .. | .... | ... |
+----+------+-----+
Run Code Online (Sandbox Code Playgroud)
我有很多表格都引用了这个表格。我可以获得引用此表的所有表的列表吗?而且,特别是,我可以获得引用该表中特定行的所有表的列表吗?
然后我需要将所有引用更新为User
12 到User
11。