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
1 answer
Schedule periodic mysql script to run automatically every hour
I've been searching, but nothing clear came up.
I wonder if there is a way to schedule a big MYSQL script which takes normally up to 2 minutes to run (with workbench not able to run in phpmyadmin cause of timeout -> server not in my hands) so that…

marko c.
- 355
- 1
- 3
- 16
0
votes
1 answer
MS SQL Stored procedure to generate a script create a copy of existing database
I want some help with creating a copy of my database in SQL Server 2008. So I found this article…

ksagar
- 305
- 3
- 6
- 20
0
votes
1 answer
Sql Server Selecting 1 single datapoint every hour or every day from a table
Hi I have several tables in sql server that record data every 30 seconds. obviously after a while that gets a bit bulky, what I'd like to do is select 1 datapoint an hour over the past 24 hours and put that into a seperate tables for fast quesries,…

Cfoote7
- 375
- 2
- 3
- 14
0
votes
1 answer
How can I get this query to print a record that only exists in one table?
I am trying to create a query that will accept a date from the user and display information from two tables based on this date. This works for all of my tests except my last test. My last test, I enter a date that should return a record that only…

Stc5097
- 291
- 1
- 11
- 25
0
votes
1 answer
Create Stored Procedure in VS2012 to drop 4 tables at once?
In an MVC Web Application I'm working on, I have 4 specific tables that are used and automatically generated for Roles Authentication. After I created a migration and seed my database, I then run the application which creates these 4…

Analytic Lunatic
- 3,853
- 22
- 78
- 120
0
votes
1 answer
Concatenate multiple SQL scripts using CodeSmith template
I'm trying to create simple tool for concatenating SQL scripts using CodeSmith.
I have template which is generally just:
header (check whether tables exists, begin transaction)
body (concatenated scripts should be placed here)
footer (commit or…

Illia Ratkevych
- 3,507
- 4
- 29
- 35
0
votes
1 answer
Creating a SQL Script from a .bak file
Hello,
How can I create a SQL Script (*.sql) file from a ".bak" file? This is for SQL Server 2005. Can I create a SQL Script with just the SQL Server 2005 Express?

Codename K
- 890
- 4
- 23
- 52
0
votes
0 answers
Database Project Management
I wanted to explore ways to develop, manage and architect databases. I would like to do the following things (at least this is what I foresee for now!).
Develop schema, specify constraints and capture all the development as installable DB…

Ace
- 1,501
- 4
- 30
- 49
0
votes
1 answer
Advance trigger programming logic in sql server
This post is quite bit longer than others and I apologized for that. so if you just interest about this please help me.
CREATE TABLE software_manual(
item_no varchar(50),
title varchar(50) NOT NULL,
description varchar(500),
manufacturer…

Roledenez
- 751
- 4
- 16
- 43
0
votes
1 answer
SQL Script Transaction Log to Table Report
I am trying to write a script that I can run to create a report that will look through a table (customer transaction log) and will count the number of times each customer uses each transaction type for each location. For report purposes I NEED only…

jcrennan
- 3
- 2
0
votes
2 answers
Scripting stored procedures in sql server 2008 without EXEC dbo.sp_executesql
I need to scripts all the stored procedures and I am currently using the wizard to do that.
However it's scripting wrongly when a stored procedure has Quotes by creating double quotes.
How can I script a stored procedure without
EXEC…

user9969
- 15,632
- 39
- 107
- 175
0
votes
0 answers
Execute large sql script file having stored procedure
I have a large (1.2GB) sql(server) script file which includes lots of stored procedures. I want to execute this large file. The first problem is I cannot open the file in SQL Server Management Studio. So, I tried the following code:
declare…

MIIB
- 1,849
- 10
- 21
0
votes
2 answers
Defining a 1: 0 ...1 relationship in sql command
I want to set up two tables in sql command.
I have a Customer table and a User Account table.
A Customer has none or at most 1 User_account (0...1) relationship.
But a USER_ACCOUNT will always have a CUSTOMER.
How can I do it via SQL command?
EDIT…

hsim
- 2,000
- 6
- 33
- 69
0
votes
1 answer
Run SQL script on the server from within SQL developer on the client?
I am trying to create a pluggable database and am executing commands through sqldeveloper.
For enabling the 32k varchar support I need to run the script "@?/rdbms/admin/utl32k.sql;"..This script is present in the oracle database server. But my…

Zenil
- 1,491
- 3
- 12
- 21
0
votes
1 answer
Use batch to back up table with huge data
I have a super huge table (300+ million rows) that I need to back up frequently. I used a backup table to do so. Currently, the backup table is pretty much behind the main table, so I want to update my backup table. I want to copy over rows that…

user2701646
- 139
- 4
- 4
- 20