Written by

Question Vivek Nayak · Sep 6, 2019

How to execute multiple query or script in sql management studio?

I want to insert multiple records in the table using below queries, but it gives an error.

Comments

Robert Cemper · Sep 6, 2019
Insert into LISDB.State (short,long)
SELECT 'AL','Alabama'
Union All
SELECT 'AK','Alaska'
Union All
SELECT 'AZ','Arizona'
Union All
SELECT 'AR','Arkansas'
0
Evgeny Shvarov · Jun 9, 2020

Suppose you have your sql script in script.sql

You can call the following command:

do $System.SQL.DDLImport("IRIS",$Username,"/path/script.sql")

It will execute all the lines one-by-one.

Learn more in documentation.

0
Mathew Lambert · Jun 15, 2020

There is no pretty way to do it via management portal.

Either use a JDBC tool like squirrel or sql workbench, or use an sql file with do $System.SQL.DDLImport

0