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.
.png)
.png)
Discussion (3)0
Comments
Insert into LISDB.State (short,long)
SELECT 'AL','Alabama'
Union All
SELECT 'AK','Alaska'
Union All
SELECT 'AZ','Arizona'
Union All
SELECT 'AR','Arkansas'
SELECT 'AL','Alabama'
Union All
SELECT 'AK','Alaska'
Union All
SELECT 'AZ','Arizona'
Union All
SELECT 'AR','Arkansas'
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.
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