[dba-SQLServer] Data Transformation Question

Darryl Collins Darryl.Collins at coles.com.au
Mon Jul 7 00:43:35 CDT 2008



hmmm... speaking of dumb...  I do a bit more research into this (outside of SQL help) and found it why it works, why it is different from delete and tested it a few times in a sproc.

So far so good.  Although I am suprised that I still cannot find it in MS help.

cheers
Darryl.

-----Original Message-----
From: Darryl Collins
Sent: Monday, 7 July 2008 3:26 PM
To: 'Discussion concerning MS SQL Server'
Subject: RE: [dba-SQLServer] Data Transformation Question



ok....  I cannot find anything about TRUNCATE in the help - I am using SQL Server 2000 so maybe this method is a later addition to SQL Server.

Sorry if this is a dumb question, I am pretty green at this SQL businesss.

cheers
Darryl


-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Robert
L. Stewart
Sent: Monday, 7 July 2008 1:05 AM
To: dba-sqlserver at databaseadvisors.com
Cc: Darryl Collins
Subject: Re: [dba-SQLServer] Data Transformation Question


Darryl,

Unless you want the deletions to take longer and be recorded in the log,
you would do a TRUNCATE TABLE MyTable in an Execute SQL task. Then, you
would link it to the other one with an On Success join line (the green one
changed to blue).

Robert

At 12:00 PM 7/4/2008, you wrote:
>Date: Fri, 4 Jul 2008 10:09:23 +1000
>From: Darryl Collins <Darryl.Collins at coles.com.au>
>Subject: [dba-SQLServer] Data Transformation Question.
>To: "'Discussion concerning MS SQL Server'"
>         <dba-sqlserver at databaseadvisors.com>
>Message-ID:
>
><57E6E6CA42105A48B977303A2CDC2720076BF12CC1 at WPEXCH22.retail.ad.cmltd.net.au>
>
>Content-Type: text/plain; charset="us-ascii"
>
>
>Hi Guys and Gals,
>
>I have create some local packages using the Data Transformation
>wizard so I can pull data in from an Access Database into SQL
>Server.  This process works great and I have ask for it to be run
>once a day ra ra ra.
>
>Problem is when it runs it just keeps appending data to the table,
>rather than replacing the existing data.
>
>How can I get the package to remove all the existing data in the
>table first, and then import the updated data from the external database.
>
>AirCodeish.
>
>DELETE * FROM tbl_MyTable
>Then Run the local package.
>
>This cannot be hard to do, but I just cannot see how it make it work.
>
>Regard
>Darryl


_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com


This email and any attachments may contain privileged and confidential information and are intended for the named addressee only. If you have received this e-mail in error, please notify the sender and delete this e-mail immediately. Any confidentiality, privilege or copyright is not waived or lost because this e-mail has been sent to you in error. It is your responsibility to check this e-mail and any attachments for viruses.  No warranty is made that this material is free from computer virus or any other defect or error.  Any loss/damage incurred by using this material is not the sender's responsibility.  The sender's entire liability will be limited to resupplying the material.




More information about the dba-SQLServer mailing list