SQL Scripts are lists of SQL sentences written in a single file, meant to be executed sequentially. Depending on the particular RDBMS system, SQL scripts can have procedural language characteristics, such as control-of-flow constructs.
Questions tagged [sql-scripts]
437 questions
73
votes
4 answers
Executing script file in h2 database
First of all I would like to say am new to h2 database. I need to execute a sql script file in h2 database. I have a script file test.sql and I want to execute this in h2 database. Is it possible?

Kamalam
- 1,254
- 6
- 18
- 32
69
votes
6 answers
SQL Server - Running large script files
I have a database table on a development server that is now fully populated after I set it running with an import routine for a CSV file containing 1.4 million rows.
I ran the Database Publishing Wizard on the table, and now I have a 286MB SQL…

tags2k
- 82,117
- 31
- 79
- 106
69
votes
10 answers
T-SQL STOP or ABORT command in SQL Server
Is there a command in Microsoft SQL Server T-SQL to tell the script to stop processing?
I have a script that I want to keep for archival purposes, but I don't want anyone to run it.

Phillip Senn
- 46,771
- 90
- 257
- 373
45
votes
4 answers
How can I describe a table in Oracle without using the DESCRIBE command?
I'm having a hard time with a class I am taking. We need to write an Oracle script that will act just like the DESCRIBE command. The book we are using describes how to work with the Data Dictionary very poorly. Not looking for answers, but a point…

patricksweeney
- 3,939
- 7
- 41
- 54
43
votes
1 answer
executing a .sql file in sql plus terminal
I have written couple of sql scripts in a text file and saved them with a .sql extension. I want to execute these scripts in the sql plus terminal without having to manually type the standalone sql scripts, but i'm struggling with it. If someone…

shashwatZing
- 1,550
- 1
- 17
- 24
42
votes
12 answers
How to Execute SQL Script File in Java?
I want to execute an SQL script file in Java without reading the entire file content into a big query and executing it.
Is there any other standard way?

Vladimir
- 12,753
- 19
- 62
- 77
38
votes
7 answers
How to run SQL scripts and get data on application startup?
I am developing a Spring Boot application. At the moment some of my configs are hard coded (e.g. Hystrix properties).
So I would like to get these configs on my application start up time or just after that.
Is it possible to do that using Spring…

Laurynas
- 972
- 2
- 11
- 24
33
votes
2 answers
MySQL columns with DEFAULT NULL - stylistic choice, or is it?
In many flavors of SQL, there are three ways you can implicitly set a column to NULL on every row insertion. These are:
columnname type NULL
columnname type DEFAULT NULL
columnname type NULL DEFAULT NULL
I.e. the first one sets the NULL flag (as…

Kevin Jin
- 1,536
- 4
- 18
- 20
26
votes
3 answers
script to restore database sql server from bak file, doesn't work
I have an empty database:
DB_Clients
And I want to restore the database from a .bak file:
OldDBClients.bak
This is the path:
C:\OldDBClients.bak
And this is my script:
USE [master]
GO
RESTORE DATABASE DB_Clients
FROM DISK =…

Esraa_92
- 1,558
- 2
- 21
- 48
24
votes
1 answer
Mysql: How to call sql script file from other sql script file?
Suppose I have wrote script Table_ABC.sql which creates table ABC. I have created many such scripts for each of required tables. Now i want to write a script that call all of these script files in a sequence so basically I want another script file…

Maddy.Shik
- 6,609
- 18
- 69
- 98
24
votes
3 answers
SQL Server database last updated date time
Is there any sql script to find out when the database in SQL server is last updated?
I want to know the last updated date time for the changes done on meta data of the database rather than actual data inside the table.
Particularly when:
Any new…

Nagendra Baliga
- 345
- 1
- 5
- 15
16
votes
1 answer
Any easy way to generate a build script from an H2 database?
let's image that one creates an H2 database with table, indexes, etc... Is there an easy way to extract a SQL script to recreate the structure of this database in another H2 database?
I am not referring to the content of the tables, indexes, etc...…

Jérôme Verstrynge
- 57,710
- 92
- 283
- 453
16
votes
7 answers
How do I generate a script of all database objects in Toad for MySQL
In the freeware version of Toad for MySQL (latest version), I can generate a script of all tables in my database in one file. However, for stored procedures and functions, Toad generates a separate script/file for each one.
Ideally, I'd like a…

JohnB
- 18,046
- 16
- 98
- 110
14
votes
7 answers
How to run multiple SQL scripts using a batch file?
I have a case where i have got 10+ SQL script.
I don't want to go and run all my scripts 1 by 1.
Is there a way that i can run all my scripts in succession in SQL Management studio.
I found this post. Creating a batch file seems easier.
This is all…

Willem
- 9,166
- 17
- 68
- 92
12
votes
6 answers
Execute scripts by relative path in Oracle SQL Developer
First, this question relates to Oracle SQL Developer 3.2, not SQL*Plus or iSQL, etc. I've done a bunch of searching but haven't found a straight answer.
I have several collections of scripts that I'm trying to automate (and btw, my SQL experience…

Didjit
- 785
- 2
- 8
- 26