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
2
votes
3 answers
SQL SERVER and SET ANSI_NULLS ON, SET QUOTED_IDENTIFIER ON
So I have been blindly using ansi_nulls on, quoted_identifier on when creating scripts, because sqlserver generates them automatically when scripting objects..
I don't really have time to concern myself with such trivial non-sense :-) But i guess…

joedotnot
- 4,810
- 8
- 59
- 91
2
votes
1 answer
Database Migration with the flyway or dbup(.net library/dbup extension) with PostgreSQL
First of all, I am sorry because it might be a stupid question but after a day research I am confused and I have a very less time to decide.
We are using TFS as a CI tool and as an SCM. And Postgresql for DB.
Planning to Automate DB with Postgresql…

Darshana Patel
- 507
- 1
- 11
- 25
2
votes
5 answers
Is it possible to write a SQL script for both MySQL and PostgreSQL?
I'd like to write a single SQL script that will run on a default installation of either MySQL or PostgreSQL (versions 5.5 and 9.0, respectively). Is this possible?
I can almost do it by adding SET SESSION sql_mode='ANSI'; to the start of the script…

Whatsit
- 10,227
- 11
- 42
- 41
2
votes
3 answers
SQL Developer script output to datagrid
In Oracle SQL Developer, I can get simple query results returned in the 'Query Results' grid, but if I need to use variable in script, I need to use the 'Run Script' option and my results show up in 'Script Output' window, and I can't export it to…

mak101
- 147
- 1
- 11
2
votes
0 answers
Entity Framework Core Run Custom Scripts
Each time my site starts, I want to run X number of scripts. The last thing the Startup.Configure method will do is call my method:
DbInitializer.Initialize(context);
if (env.IsDevelopment()) {
…

Grandizer
- 2,819
- 4
- 46
- 75
2
votes
0 answers
Insert Into Statement For Blob Not Working But No Error
I'm trying to transfer 1.5 million of data with blob datatype.
I've tried using insert into statement and manually execute via MySQL Workbench.
I tried to insert it per year, the first year was successfully inserted. (2k+ records), but the 2nd year…

fLen
- 468
- 4
- 13
- 25
2
votes
4 answers
HANA - Passing string variable into WHERE IN() clause in SQL script
Lets suppose I have some SQL script in a scripted calculation view that takes a single value input parameter and generates a string of multiple inputs for an input parameter in another calculation view.
BEGIN
declare paramStr clob;
params = select…

Jenova
- 21
- 1
- 1
- 4
2
votes
2 answers
MySql conditional stop script execution
I need to write SQL script which stops if some values not found in DB.
Something like this (pseudo-code):
BEGIN;
...
set @a = (select ... );
if @a IS NULL THEN STOP_WITH_ERROR_AND_ROLLBACK();
...
COMMIT;
Can anybody help to me?
UPDATE: for some…

Alexander Kiselev
- 446
- 3
- 16
2
votes
1 answer
Getting maximum string length exeeded error when inserting a CLOB in HANA (longer than 7FFFFF)
We are trying to insert a large string into a table column and getting an error "length can't exceed maximum length(8388607 bytes)". (0x7F FFFF). The input data field length exceeds 10MB.
HANA version SPS 9 (Rev 97)
Data type of variable and table…

Dinesh
- 4,437
- 5
- 40
- 77
2
votes
5 answers
How to SELECT from a table if no data exists in another
This should be simple. I don't know why I feel stumped.
I have two similar tables. Let's say they each have just 2 columns: PartNumber, and Order.
In a single statement, I want to select the PartNumbers from WorkItemPartsFiltered where Order = ABC,…

LCIII
- 3,102
- 3
- 26
- 43
2
votes
4 answers
How to apply SQL scripts on a remote SQL Server?
I'm trying to completely automate my builds and part of it is applying SQL scripts to the SQL Server.
I've created a batch file that calls SQL Server utility (OSQL.EXE) to apply scripts and it works if I call it directly on the SQL server.
But I…

z-boss
- 17,111
- 12
- 49
- 81
2
votes
1 answer
How to select value from xml column in sql table
I have a table as below:
CREATE TABLE [dbo].[testdb](
[Id] [int] NOT NULL,
[Description] [nvarchar](4000) NULL,
CONSTRAINT [PK_testdb] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF,…

Tun
- 824
- 3
- 16
- 30
2
votes
2 answers
In the Visual Studio SQL editor, how do I get rid of the boxes?
I usually create my SQL tables and stored procedures by writing a script inside Visual Studio. This works really well for me except for one simple annoyance: VS puts blue boxes around all the SQL queries and data-manipulation commands. The purpose…

Jeffrey L Whitledge
- 58,241
- 9
- 71
- 99
2
votes
1 answer
Check if the nullable column is sparsed or not query in SQL Server
How to check if a column has been set as Sparse or not?
I know how to add the sparse while creating or altering tables
ALTER TABLE T1
ALTER COLUMN C1 VARCHAR(50) SPARSE NULL
GO
And it is possible to execute sparse query for the sparsed column. But…

MJK
- 3,434
- 3
- 32
- 55
2
votes
2 answers
Is it possible to execute an SQL script file using PetaPoco?
I have an SQL script file (that is, a file with a .sql extension) and I want to execute it using PetaPoco in C#. Is that possible?

CodeArtist
- 5,534
- 8
- 40
- 65