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
0
votes
2 answers
What is the best way to versoining in install/ upgrade scripts?
Sometimes, I use any of the following mentioned names to name the install/upgrade scripts in custom…

Sukeshini
- 1,241
- 2
- 23
- 48
0
votes
2 answers
DB2 executing a Script in another Script
I am facing a problem in DB2. In my Oracle environment it was very easy for me to include multiple scripts in one master script, which were executed sequentially. e.g.:
Master.sql:
connect ....
@script1.sql
@script2.sql
Now I have to build up…

cyruz
- 37
- 1
- 1
- 6
0
votes
1 answer
Using cursors sql?
I am doing a project using sql cursors, for one cursor i want to loop through a dataset of Company ids.
How would you use logic such as
Tables without CompanyID need all data copying.
Always copy data where CompanyID = 0
How would you perform this…

user2520671
- 83
- 3
- 13
0
votes
2 answers
How to generate script file of a database in postgresql with insert queries instead of copy query?
In postgresql, I had taken backup. That file didn't have any insert queries instead it used Some copy statments like
COPY user_customers (userid, customerlist) FROM stdin;
anil customer1:customer2
babu customer1:customer4
srikakulapu…

ANILBABU
- 297
- 2
- 6
- 21
0
votes
1 answer
Time based Unique ID's in SQL
Is there a way to set an 8 digit (8 as an example) unique ID in sql which is dependant on the current date and time?
I have seen this on a piece of software that I use and have been told that its possible to generate this in SQL.
Has anyone done…

Pete
- 27
- 1
- 10
0
votes
2 answers
How to do a string operation on all data of a column in an Oracle database table?
I have a table like give bellow (table name IDN_CONSUMERS),
| USER_ID | USERNAME |
| 001A | ABC/Anne |
| 034K | ABC/John |
| DF23 | ABC/Peter |
I need to remove the ABC/ part of the all username and put the modified value back to the…

SureshAtt
- 1,891
- 2
- 17
- 22
0
votes
0 answers
SQL script that automatically detects free appointments in MySQL database
In my application, users are able to check if a specific appointment is free. So they choose a specific date and time and specify the length of the appointment.
An SQL script checks if there is already an appointment at the specific time. What I…

nimrod
- 5,595
- 29
- 85
- 149
0
votes
2 answers
Need help to execute sql scripts within stored procedure
Need help as how I can trap any errors related to executing a sql script in a stored procedure.
select sopScript
from M_SopInsert
where soptype = @soptype and sopnumbe = @sopnumbe and lnitmseq = @lnitmseq
If result_count > 0 //if result from…

Anirudh
- 581
- 5
- 14
- 32
0
votes
1 answer
read SQL script file of 9 GB
I tried reading a very large MySQL script file with MySQL Workbench but it doesn't react.
Tried with a freeware app (HeidiSQL) but it crashes.
Any idea how I can read it?

Ozkan
- 3,880
- 9
- 47
- 78
0
votes
1 answer
Cannot run SQL script on Oracle Database 10g Express Edition
I'm trying to upload a script, and the file is being uploaded fine, but in the Script Editor window where I'm going to actually run the script, the entire file content is shown on one line and the whole edit area is in red. I'm not being able to run…

supriyo_basak
- 505
- 1
- 7
- 24
0
votes
2 answers
SQL Server: Stopping Queries Externally
I run queries using SQLCMD utility via PHP and I wanted to know if there was a way to stop queries or scripts that I have executed via another SQL command by passing the process ID or something.
I also make use of the PHP Driver for SQL Server would…

Abs
- 56,052
- 101
- 275
- 409
0
votes
1 answer
Making the database and data access versions equal
There is a database and a data access layer(DAL) they are dependent on eachother.
Whenever the portal starts I need to automatically run a script that checks to see if there has been a change in the one or the other. If the versions are the same,…
0
votes
4 answers
Oracle: dynamically select script
How do I run a script in SQLPlus whose pathname is passed in a string. Something like the following (fails):
SET SERVEROUTPUT ON;
DECLARE
path VARCHAR2(128);
BEGIN
path := '' || 'test_script.sql';
dbms_output.put_line(path);
…

ThomasMcLeod
- 7,603
- 4
- 42
- 80
0
votes
2 answers
Mysql sql script
I have a table T with a few columns out of which 1 column is having comma separated values. I want to process this column and update for all rows in the following manner
the column contains values like "15,20"; "30,15,50" (not in sorted order). And…
0
votes
1 answer
Easiest way to execute a script in Visual Studio 2010 Express?
I'm looking for an easy way to run an SQL file on my SQL Express from Visual Studio Express.
When not using express, this way is nice and easy.
So far, using sqlcmd seems like my fastest option (i have a batch file for easy drag and drop…

ericosg
- 4,926
- 4
- 37
- 59