SQL Server view takes a long time to alter but query itself finishes quickly?
Make sure there's no contention for that view. If something else is accessing it, or if there's a spid somewhere that's idle but has a connection to it, you may be blocked from the ALTER
statement.
A simple sp_who2 active
during the ALTER
should give you the culprit.
I am too late for a response but I got the same issue. I just used kill (spid
) for current query editor and then closed ssms and open it again and it is working fine for me.