SELECT 'EXEC sp_rename @objname = ''' + TABLE_NAME + '.' + COLUMN_NAME + ''', @newname = ''' + LOWER( COLUMN_NAME ) + ''', @objtype = ''COLUMN'''
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME='tb_xxx'
SELECT 'EXEC sp_rename @objname = ''' + TABLE_NAME + '.' + COLUMN_NAME + ''', @newname = ''' + LOWER( COLUMN_NAME ) + ''', @objtype = ''COLUMN'''
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME='tb_xxx'
转载于:https://www.cnblogs.com/lobtao/articles/5793175.html