Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


sql scripts

Posted on 2013-06-01
Medium Priority
Last Modified: 2016-02-11
i have a script that updates a field in the table.
i want to break the script into 4 parts.
how do i call the script one after the other without using a ssis package?
Question by:package_monkey
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 18

Expert Comment

by:Matthew Kelly
ID: 39213541
How are you calling them now?

Generally, you could make them stored procedures, and then just have one script call each procedure.

Lots of examplese of stored procedures here: http://msdn.microsoft.com/en-us/library/ms187926(v=sql.90).aspx

Author Comment

ID: 39213836
i have a package that executes sql tasks, it creates a  temp table.
next temp table is populated with the the values from 4 fields from the production table.
i update the table with another temp table which is created using inserts from the excel sheet.
then i use inner join to update the production table using the updated temp table.
my question is how do i break the scripts? i do not want to run the whole sucker as one script.
LVL 18

Expert Comment

by:Matthew Kelly
ID: 39214371
The four scripts you want are:

1. Scripts

Creates a  temp table.

2. Scripts

Populate temp table with the the values from 4 fields from the production table.

3. Scripts

Update the table with another temp table which is created using inserts from the excel sheet.

4. Scripts

Use inner join to update the production table using the updated temp table.
You then want the single SSIS package you have to execute all four scripts in order when called?

To do that, the best method is to create four stored procedures, each one doing one step of the above tasks; then have the SSIS package call each of the stored procedures. You would also be able to call the stored procedures manually one at a time without the package as well.

Is it timing out? Is that why you want to break the scripts up?
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.


Author Comment

ID: 39214401
i do not want to  run it in a one swing, as so many rows are being inserted and updated.
i do not want to cause any problem down the pipeline.

Author Comment

ID: 39214417
it is a one time update. that is why i do not want to do it as a package or as a stored procedure.
LVL 25

Accepted Solution

jogos earned 1200 total points
ID: 39214532
Split your script in 4 and then you have (besides running it in a sql-window) different options



Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question