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

Schedule creation of a stored procedure

I have a Test database which is overwritten each week by a fresh new production copy. But we have changes in our Test environment which I script in manually each Monday morning after the copy is created. Is there a way to schedule script code to run…
ErickTreetops
  • 3,189
  • 4
  • 27
  • 37
0
votes
2 answers

How to sort results by conditions?

I have lots of keywords - "b1,b2,b3,a1,z1" which later would be composed as a query condition to do a query from a database. It's like this: SELECT * FROM sometable WHERE id IN (b1,b2,b3,a1,z1) But the search results are a mess in order. …
ske
  • 4,694
  • 3
  • 23
  • 35
0
votes
2 answers

Executing PHP Script In MySQL

Any solutions to run an action in MySQL when table is updated? If so, how about taking values from the updated table and passing it to the script to run it?
alexel
  • 197
  • 1
  • 1
  • 11
0
votes
1 answer

Unable to run SQL script in Oracle g10 XE

I'm trying to upload and run an SQL script. I can upload it fine, but when when I go to run/edit I just have a red box, and the only button that works is delete. Google tells me it's a browser issue, and that it will work on IE, but I've tested…
Kat
  • 11
  • 4
0
votes
0 answers

How to display the SQL script for a database using SQL script

I have a local .mdf file I use it as a database in my asp.net webforms website, since I don't have Microsoft SQL Server and I have Visual Studio v2015 also I have a connection string here : Data…
0
votes
1 answer

SQL script Help needed

I am working on a following query and not able to figure out one thing.The result of the main query at bottom are in the following way:- Institute name || Total users || Students || teachers || professionals || Email || Country of Teacher.** I want…
Rish
  • 25
  • 6
0
votes
0 answers

Broken PowerShell Script

I have a SQL DB that is populated with Consultants at our company and the Client Groups that they are associated with. I have a PowerShell Script that checks this database and adds or removes Consultants from corresponding O365 Security…
0
votes
2 answers

Deploy Sql Server in .NET using my application

I have winforms application in my company to deploy applications in several environments (Development, PreProduction, Production). Now, I want to include a new functionality: I need to deploy SQL Server scripts in environments: development,…
Kiquenet
  • 14,494
  • 35
  • 148
  • 243
0
votes
1 answer

Compile Script file in SQL Developer (ORACLE)

I am executing a script file (c:\sqlfiles\Test.sql) from SQL Developer. File contains below statements @@test1.sql; @@test2.sql; @@test3.sql; All these sql files contains function or procedures. But the problem is while running the command…
Thej
  • 275
  • 2
  • 7
  • 18
0
votes
1 answer

Preventing Multiple Inserts with SQL Patch Script

I have a SQL script which is meant to work as a patch, so that it's only intended to run one time to modify some entries in a database: INSERT INTO Table1 ... INSERT INTO Table2 ... etc... If customer service (or whoever is applying the patch) were…
Mike
  • 825
  • 3
  • 12
  • 30
0
votes
1 answer

controlling hibernate sql script run

I am using Spring 4.1.6, and I have my service working fine with Hibernate. In the root of the project I've got my schema.sql which is being run every time I run the server. The problem is that first time I ran the server, I put some data in db, and…
jscherman
  • 5,839
  • 14
  • 46
  • 88
0
votes
0 answers

employee supervisor hierarchy in HANA( Sql script code)

I am looking for SQL Script code(HANA) to take the input “EMPLoyee table available in the below format and give me the Desired output table . Input Table EMP_MGR_HOD: All employees with their immediate supervisors and HODs EMPLID EMP_NAME…
0
votes
1 answer

regex on sql script

I need to perform a search and replace operation on hundreds of SQL script files. The idea is to transform this: USE [DB] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /* comments xxxx */ ALTER PROCEDURE .... BEGIN ... …
ab_732
  • 3,639
  • 6
  • 45
  • 61
0
votes
1 answer

Update null columns with custom unique ids

I have a table as below: CtId CustomerID 1 2600000897685 2 NULL 3 2600000089765 4 NULL 5 2600789657465 6 NULL 7 NULL 8 NULL I need a sql script updating null column id with my custom unique id. Increment unique number starts…
Tun
  • 824
  • 3
  • 16
  • 30
0
votes
2 answers

Alter column length with or without data in table

Its about ORACLE (PL/SQL) script. I am not very familiar with databse to be honest. I want to alter the length of a string in a column from 30 to 60. It is not null column. If the table is empty and I run following script then it works: alter…
Charychap
  • 69
  • 1
  • 7