Column Rename Example

1

Please login or register to vote for this query.

(click on this box to dismiss)

Column Rename Example

Cardano Meta

Q&A for users and developers of the Cardano cryptocurrency ecosystem

SELECT 'EXEC sp_rename ''' + TABLE_NAME + '.' + QUOTENAME(COLUMN_NAME) + ''', ''' + REPLACE(REPLACE(COLUMN_NAME, 'Count', 'Cnt'), 'View', 'Vw') + ''', ''COLUMN''; ' 
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE COLUMN_NAME LIKE '%Count%' 
    OR COLUMN_NAME LIKE '%View%'

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results