GullitsMullet
GullitsMullet

Reputation: 358

SQL alter table query stuck in execute

I'm trying to run an alter table query to add columns to an existing table:

ALTER TABLE dbo.Names
Add solCorporate bit null

When I execute it just sticks in the executing query cycle, I've left it for 20 mins and nothing.

Any ideas? I'm presuming if there was a code error it would flag before running.

Thanks.

Upvotes: 2

Views: 4683

Answers (3)

Yoav24
Yoav24

Reputation: 363

This happened to me while I was using the view in SSIS. Once I closed the SSIS project in Visual Studio, the execution finished immediately.

It is possible another program is hogging access to the view.

Upvotes: 0

Nick Gallimore
Nick Gallimore

Reputation: 1263

Closing SQL server management studio worked for me

Upvotes: 0

Maurice Klimek
Maurice Klimek

Reputation: 1092

I ran into the same problem today. I tried to stop the database connection by right-clicking it and choosing Stop (in the Object Explorer in MS SQL Server Management Studio).

When that didn't help I launched Sql Server Configuration Manager and restarted the SQL Server from the SQL Server Services tab. After that, Alter table ran in a second.

Upvotes: 2

Related Questions