Sergio Tapia
Sergio Tapia

Reputation: 41228

How to concatenate several create table sentences so the script runs everything with one execute command?

For example, say I have this SQL Script:

create table Person
(
    id int primary key,
    name nvarchar(40)
)

create table Country
(
    id int primary key,
    name nvarchar(40)
)

How can I have those commands in a single file and be able to run it?

Upvotes: 2

Views: 171

Answers (1)

Fabian
Fabian

Reputation: 13691

Add GO after each create table statement.

Upvotes: 5

Related Questions