I am trying to alter an existing view in my SQL Server database. When I run the query by itself it finishes in about 4 seconds. When I run the alter statement with the same query it runs and never finishes (waited 15 minutes before stopping it).
I do not have any indexes on the view I am trying to alter. Any ideas what would cause something like this to happen? Is there something I should be doing differently to speed things up?
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
ALTERstatement.A simple
sp_who2 activeduring theALTERshould give you the culprit.