Mohammad Sheykholeslam
Mohammad Sheykholeslam

Reputation: 1437

My script can't execute alter database command SQL Server 2008

I created a database then I create a procedure. When I want to alter this database, I got an error while altering this database says:

create/alter must be the first statement in a query batch

Upvotes: 0

Views: 370

Answers (1)

BartekR
BartekR

Reputation: 3977

If you have more than one statement to run use 'GO' command:

alter database xyz ...
GO

INSERT INTO myTable() ...
GO

etc

Upvotes: 1

Related Questions