I have a table with bunch of columns such as Policy Number, Person name and etc... How do I write a code that replaces the space between "Policy Number" to "Policy_Number"? In short, I want to modify all the column names to replace space in between the characters to underscore. Thank you for helping!
1条答案
按热度按时间bmvo0sr51#
In SQL Server, you can dynamically rename column names to replace spaces with underscores using a combination of SQL queries and T-SQL script. Below is a code snippet that demonstrates how to achieve this: