I was attempting to remove a column from a table within SQL Server 2012 for one of our developers. As a precaution, before dropping the column, we rename them to make sure that everything continues to work as expected. To do so, I used sp_rename:
EXEC sp_rename 'schema.mytable.old_column', '_rm_old_column', 'COLUMN';
GO
SSMS reported command completed successfully. Shortly after, SQL Server reported many queries being blocked by this query (the sp_rename query had grabbed a table lock). There was nothing blocking the sp_rename query, but it was doing nothing. Any ideas what could have been going on here? My biggest concern is that the SSMS window said everything had executed successfully while it was still running.
Aucun commentaire:
Enregistrer un commentaire