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
3
votes
1 answer

Scheduling a sql script from oracle sql developer

I have created a script to automate data extraction and saved in the location: C:\Users\Jeni\Desktop\Status.sql And I call the script manually from Oracle Sql Developer by running the command @C:\Users\Jeni\Desktop\Status.sql as a script How can I…
3
votes
2 answers

IDENTITY_INSERT SQL script

Situation I have a SQL script that I need to push some basic data to my database. Therefore I use the following script (and others). I want to provide manually an primary key for the rows I manually create. Problem If I execute the script it will…
Timon Post
  • 2,779
  • 1
  • 17
  • 32
3
votes
2 answers

Calculate results with LIFO method via TSQL

I want to make calculation via LIFO (last in first out) method with TSQL. Using LIFO method will require you to calculate profit/loss by selling last transactions. Example how it works: deal is concluded on 1 march we BUY 10 stocks for 5 dollars…
Kirill Pashkov
  • 3,118
  • 1
  • 15
  • 20
3
votes
1 answer

cant call and execute .sql script file in Oracle anonymous block

I am trying to run the below anonymous block but getting an error ORA-00900: invalid SQL statement. I know its not possible to issue DDL as static SQL in a PL/SQL block in Oracle. As i have more than 50 sql scripts which needs to be executed in…
Andrew
  • 3,632
  • 24
  • 64
  • 113
3
votes
3 answers

What is the equivalent of T-SQL ISNUMERIC function in HANA Sqlscript?

I have a requirement where I need to convert all SQL Server stored procedures into HANA stored procedures. I have come across a function ISNUMERIC in T-SQL and I am not getting the equivalent of it in HANA. After searching the web, I found that HANA…
AnandPhadke
  • 13,160
  • 5
  • 26
  • 33
3
votes
3 answers

How to insert blob data into the embedded HSQLDB of Spring through the sql script?

This is my sql script creating the database: create table product (id integer identity primary key, name varchar(50) not null, price decimal(10,2) not null, image blob(1024), category_id integer); This is my sql script, which inserts data to the…
akcasoy
  • 6,497
  • 13
  • 56
  • 100
3
votes
3 answers

How to put MySQL code into source control?

I know I can copy all my MySQL code manually to files and then put those files into source control. But is there any way to do this automatically? I would like to do this to stored procedures, but also to table/event/trigger creation scripts.
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
3
votes
3 answers

Sql Query Compare and Sum

I have these problem I need to match the sum a columns to see if they match with the Final Total of the Invoice by Invoice Number ( I am working in a query to do it) Example Invoice No Line _no Total Line Invoice total Field I will…
Luis64
  • 33
  • 4
3
votes
3 answers

Specifying a relative path in Post-Deployment SQL files

We have a post-deployment script in our SQL Server project which essentially performs a bulk-insert to populate tables after they're created. This is done by reading several .csv files: BULK INSERT [dbo].[Table1] FROM…
Arian Motamedi
  • 7,123
  • 10
  • 42
  • 82
3
votes
3 answers

Execute a .SQL file in Powershell without having SQL Server installed?

I need to provide a powershell script that runs a bunch of steps to install a custom solution. One of these steps is create a SQL Server database and execute a .sql file to generate the schema. The thing is that I need a way of doing it in any…
empz
  • 11,509
  • 16
  • 65
  • 106
3
votes
4 answers

How to execute sql-script file using hibernate?

I gonna write several intergration tests which will test interatcion with db. For each test I need to have a certain snapshot of db. Each db snapshot saved in .sql file. What I want is to execute certain script file in certain test method, like…
Vladimir
  • 12,753
  • 19
  • 62
  • 77
3
votes
2 answers

How do I execute a large SQL Script with many GO statements from within Delphi?

We have an updater application which executes SQL scripts of over 30,000 lines of code on a SQL Server database. In this script is a large number of GO statements. The ADO components which I'm used to using do not support the GO statement. We've…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
3
votes
1 answer

Ignore error in executing SQL Script

How can I make my code ignore the error while executing SQL Script file? If there is an error while executing the sql script file, then I want this method to just ignore it and continue to run the sql script file. Currently, if I put try-catch block…
Butters
  • 947
  • 5
  • 16
  • 25
3
votes
1 answer

Add new columns while generating scripts in sql server 2008

I' trying to generate the scripts for ma DB in Sql Server 2008.. and i'm able to do that, the scripts generated is : USE [Cab_Booking] GO /****** Object: Table [dbo].[User] Script Date: 05/19/2013 10:33:05 ******/ SET ANSI_NULLS ON GO SET…
Sandeep
  • 278
  • 1
  • 6
  • 21
3
votes
1 answer

Programmatically generate SQL script to create database without PRIMARY statement .. using scripter

I have create script which is automatically generated by Scripter.Script() method. But if want to get rid of file paths included in the script. Which property is need to be set while using Scripter class to generate script ? SQL Script: CREATE…
Tulsi
  • 151
  • 3
  • 15