Forum Discussion
How to detect that a column was renamed
but I can't find a way to detect when a column was renamed.
Mauricio1502 , your post is not very clear for me, what the situation is and what you are trying to achieve. SQL Server don't log such changes on it's own, you would have to implement an auditing on your own, e.g. using Create DML Triggers - SQL Server | Microsoft Learn
Hi olafhelper,
let's say we have a database in Development where we do some changes and a similar database in Production. We want to propagate those changes to Production Database. Products like SQL Compare (Redgate), makes a comparison between to databases and generates a script with all the required changes, new tables, indexes, columns added, dropped, changed or renamed, etc. I want to identify, particulary, when a column was renamed.
- olafhelperFeb 26, 2024Bronze Contributor
Mauricio1502 use a SSDT database project for changes: Use Schema Compare to Compare Different Database Definitions - SQL Server Data Tools (SSDT) | Microsoft Learn
- Mauricio1502Feb 26, 2024Copper Contributor
Hi olafhelper, yes, that's an option. Now let's say I want to do it programmatically. Is there any way to detect the rename?
- olafhelperFeb 26, 2024Bronze ContributorSee the link I posted: SSDT support schema compare = detecting changes in either the database or in the project.