473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

DTS Package

I want to create a DTS package that will.

Cleardown all rows in a table called stock
Then populate stock with all data from another table called stock1.

I also want to schedule it to run everymorning.
Can anyone help?

Regards,
Ciarán
Jul 20 '05 #1
2 1504
Hi

You don't need DTS to do this, a standard SQL Agent job can have steps that
run TSQL commands.
Depending on your requirements you can either TRUNCATE the table to remove
all the records or use the DELETE statement. To re-populate the data you can
use an insert statement with a derived table. More information on these
statements are in Books Online.

To create your job you can either do it using Enterprise Manager or by using
the procedures sp_add_job and sp_add_jobstep. Again more details and
examples can be found in Books Online.

I would also recommend that you wrote a stored procedure to handle the
actions required, then you call it from the job step. This will help
maintenance and mean that you can call the same code from other places.

John

"Ciar?n" <ch********@hotmail.com> wrote in message
news:7f************************@posting.google.com ...
I want to create a DTS package that will.

Cleardown all rows in a table called stock
Then populate stock with all data from another table called stock1.

I also want to schedule it to run everymorning.
Can anyone help?

Regards,
Ciarán

Jul 20 '05 #2
If you don't feel comfortable using the SWL agent you can
write a standard SQL script to do this.
something like

delete from stock
insert stock
select *
from stock1

save it on your server, then up a batch file using the osql utility
something like:
osql /E /i c:\script_name.sql

this should then run the sql script by clicking on the batch file and
can then be scheduled to run uing the windows scheduled tasks feature.
"John Bell" <jb************@hotmail.com> wrote in message news:<%o*******************@news-text.cableinet.net>...
Hi

You don't need DTS to do this, a standard SQL Agent job can have steps that
run TSQL commands.
Depending on your requirements you can either TRUNCATE the table to remove
all the records or use the DELETE statement. To re-populate the data you can
use an insert statement with a derived table. More information on these
statements are in Books Online.

To create your job you can either do it using Enterprise Manager or by using
the procedures sp_add_job and sp_add_jobstep. Again more details and
examples can be found in Books Online.

I would also recommend that you wrote a stored procedure to handle the
actions required, then you call it from the job step. This will help
maintenance and mean that you can call the same code from other places.

John

"Ciar?n" <ch********@hotmail.com> wrote in message
news:7f************************@posting.google.com ...
I want to create a DTS package that will.

Cleardown all rows in a table called stock
Then populate stock with all data from another table called stock1.

I also want to schedule it to run everymorning.
Can anyone help?

Regards,
Ciarán

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck...
3
by: Petterson Mikael | last post by:
Hi, I have the following package names ( in an xml) that I will transform to html. I need to sort them. <package name="se.company.product.subproduct.boam.fpx.testsignals"> <package...
10
by: datapro01 | last post by:
Running DB2 8.1.6A on AIX 5.1 We are experience package cache overflows. The high water mark for package cache is showing as 16,108,513 bytes, or approximately 3933 4K pages. The package...
6
by: Page Horton | last post by:
I have a ASP.NET (VB) web application running. The DTS package is suppose to generates a flat file to a file path (aka: \\myStation\outputFiles\). When it runs it generates the following error on...
3
by: shorti | last post by:
running on AIX with DB2 v8.2.2 I ran across a problem with naming source files with similar names. For instance, if I have these three files: upd_startaccessingdb.sqc upd_startusingdb.sqc...
1
by: Laurence | last post by:
Hi folks, In the middle of page 231 on the book "Administration Guide - Implementation" stated - "In addition to these package privileges, the BINDADD database privilege allows users to create...
0
debasisdas
by: debasisdas | last post by:
PACKAGE WITH LOCAL FUNCTION ============================= create or replace package my_pkg as procedure my_proc(arg1 in varchar2); function my_fun(arg1 in number) return varchar2; end my_pkg;...
0
debasisdas
by: debasisdas | last post by:
The following thread contains some useful tips/sample codes regarding PACKAGES in oracle, that the forum members may find useful. A package is a collection of procedures,functions,cursors,global...
0
debasisdas
by: debasisdas | last post by:
SAMPLE PACKAGE EX#3 ==================== PACKAGE SPECIFICATION -------------------------------------------- CREATE OR REPLACE PACKAGE MYPACK AS PROCEDURE SHOWENAME(EMPID IN NUMBER); FUNCTION...
0
by: Steven Samuel Cole | last post by:
Hi Stephane, thanks for your reply! :-) I do not get any notification or warning or whatever from dpkg, all output I get when running # sudo dpkg -i python-<package name>_0.0.1-4927-1_all.deb...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.