Questions tagged [sql-scripts]

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.

437 questions
0
votes
1 answer

Trying to Run a SQL script file, Getting Syntax error : Incorrect syntax near '`'

I'm trying to execute a SQL script dump file which have multiple tables. I want to read data from this dump file and make a sqlite(offline) database. I'm using following SMO procedures and code is following string sqlConnectionString =…
0
votes
0 answers

DBeaver CSV to Table import. How to do scripted without import Wizard?

I have a table I routinely want to drop, then re-import and add a primary key constraint for. The thing is I don't want to step thru the wizard each time. How can I script this as a command so I don't need to interact with a GUI/wizard? If it is…
JGFMK
  • 8,425
  • 4
  • 58
  • 92
0
votes
1 answer

How to make SqlPackage exclude indexes?

We're using SqlPackage to generate scripts via the Script action. Does anyone know a way to get it to exclude indexes? Can't seem to find a way. The SqlPackage reference gives several /p: properties to do with excluding a whole raft of other object…
Reg Edit
  • 6,719
  • 1
  • 35
  • 46
0
votes
1 answer

Querying Json array column and other current table column

I have a table that has three columns from which I need to retrieve the data. One of the columns OtherNames contain an array of Json Objects. CREATE TABLE Persons ( NameID int, CurrentName varchar(255), OtherNames varchar(max), ); I can…
NoviceDeveloper
  • 1,270
  • 3
  • 15
  • 41
0
votes
1 answer

Execute SQL file on Oracle database using C#

I have written SQL scripts in a script.sql file to create procedures. This script.sql file is located in the application path. Now I've written a tool in C# that creates a database connection. I would like to run the script file with code through…
user9715288
0
votes
0 answers

Command(s) to generate script for insert into table of one DB with selected records from other DB (data migration/update)

We have a system that includes a DB with tens of tables, some with evolving DATA and some with rather static Steering information. The system is now running within a number of environments, one is the DEVEL that the others serve various purposes…
FDavidov
  • 3,505
  • 6
  • 23
  • 59
0
votes
1 answer

declare table inserted values duplicated

I try to get two different table values to insert one declare table but the employee ID is duplicate, DECLARE @WSotable TABLE ( Employee int, ChargedQty int, …
Chamod Dilshan
  • 45
  • 1
  • 1
  • 8
0
votes
0 answers

Is there a programmatic/system native way to replicate oracle roles across instances?

I'm working with 2 Oracle 19C instances: Instance1 and Instance2 Users have certain roles and resulting privileges on tables in Instance1. I have a DB link from Instance1 to Instance2 and a schema in Instance 2 that has access to all tables for all…
0
votes
1 answer

Sql scripts for creation of same table in repository tests

I have several Spring data repositories which have some joins to the same table, lets say, Client table. So in order to not repeat the sql script for the creation of the Client table for each repository test (it would be a bad practice), would it be…
fernando1979
  • 1,727
  • 2
  • 20
  • 26
0
votes
1 answer

How to run a sql script from an ant script

i need to rename a file in database using sql script. The sql script must be executed from an ant script.How can this be done?
trilawney
  • 1,786
  • 6
  • 28
  • 36
0
votes
1 answer

How to filter suggestion users by interest in SQL Server 2005?

I working on social network site in that I have 3 SQL table to search users for suggestion. for ex: user have must choose one category at registration time. User Table: userID | username | categoryID | createdOn 101 abc 2 …
Abhishek B.
  • 5,112
  • 14
  • 51
  • 90
0
votes
1 answer

SQL script within subquery (Big Query)?

Is there a way to have SQL scripts within a subquery ? For example: select col_1, col_2, count(*) from ( Declare max_radius INT64; set max_radius = 250; select * from my_table where radius < max_radius ) group by col_1,col_2 In my case it is not…
Yairh
  • 63
  • 1
  • 5
0
votes
0 answers

Is there a way to print out full Merge Script Output?

I use multiple Merge Scripts for CI/CD deployment a database. Dacpac contains Post Deployment Script which is used in Azure Devops Deploy Azure DB Task. This script is a concatenation of multiple merge scripts. I would like to somehow store detailed…
0
votes
1 answer

Example for stored procedure with output variables

I have gone through lot of tutorials on the web on how to create a stored procedure. I understand that to use a procedure, syntax is "Call procedure_name(in parameters)". But i have found no appreciable example for stored procedure which have…
pythonguy
  • 46
  • 4
0
votes
1 answer

HANA SQL Select Count (*) from multiple tables found in a table

DECLARE VI_CNT INTEGER DEFAULT 0; DECLARE VI_IDX INTEGER; DECLARE VI_LIMIT INTEGER; DECLARE VS_OUTPUTSTRG1 NVARCHAR(500); DECLARE VS_OUTPUTSTRG2 NVARCHAR(500); /* ANAGRAFICA TABELLE FLUSSI */ ANAGRAFICA = SELECT * FROM…