dbTalk Databases Forums  

Can't DELETE many tables in SQL task

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Can't DELETE many tables in SQL task in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Axel Dahmen
 
Posts: n/a

Default Can't DELETE many tables in SQL task - 01-22-2006 , 01:45 PM






Hi,

in one of my DTS scripts I want to DELETE * FROM all the tables containted
in an Access database. So I wrote a script like:

DELETE * FROM [tabA];
DELETE * FROM [tabB];
DELETE * FROM [tabC];
DELETE * FROM [tabD];

But unfortunately Access doesn't allow me to put more than one SQL statement
in an SQL task. I don't like the idea of creating 19(!) SQL tasks for each
of the tables.

What can I do?

My all-over goal is to copy current data from an SQL Server database into
the Access database. I don't want to create complex Data-Driven tasks for
each of the tables so I want to delete them first to be able to use simple
Data Transformation tasks then.

TIA,
Axel Dahmen



Reply With Quote
  #2  
Old   
Michael Cheng [MSFT]
 
Posts: n/a

Default RE: Can't DELETE many tables in SQL task - 01-23-2006 , 02:50 AM






Hi Axel,

Welcome to use MSDN Managed Newsgroup Support!

From your description, my understanding of this issue is: you want to
delete multiple tables of Access in one query. If I misunderstood your
concern, please feel free to point it out!

Unfortunately, you can not use multiple statement in a SQL task for access.
But, you can write some applications to do this job and execute in the DTS
by using the Execute Process Task.

Further more, if you only need to update an Access table, you can use the
"link table" in Access to link a table to the SQL Server, and pull the data
to the Access.

Link tables in an Access project by using the Link Table Wizard
http://office.microsoft.com/assistan...893711033&CTT=
1&Origin=EC010227041033&QueryID=Uao8zc53Y0&respos= 1&rt=2

Hope this will be helpful! If there are further questions on the issue,
please feel free to let us know.

Have a great day!


Sincerely yours,

Michael Cheng
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #3  
Old   
Axel Dahmen
 
Posts: n/a

Default Re: Can't DELETE many tables in SQL task - 02-07-2006 , 01:34 PM



Great idea, thanks! With your solution I now even can iterate dynamically
through all Access tables without hard-coding which tables to fill.

Tnx!
Axel

----------
"Michael Cheng [MSFT]" <v-mingqc (AT) online (DOT) microsoft.com> schrieb im
Newsbeitrag news:ctKkjo$HGHA.3944 (AT) TK2MSFTNGXA02 (DOT) phx.gbl...
Quote:
Hi Axel,

Welcome to use MSDN Managed Newsgroup Support!

From your description, my understanding of this issue is: you want to
delete multiple tables of Access in one query. If I misunderstood your
concern, please feel free to point it out!

Unfortunately, you can not use multiple statement in a SQL task for
access.
But, you can write some applications to do this job and execute in the DTS
by using the Execute Process Task.

Further more, if you only need to update an Access table, you can use the
"link table" in Access to link a table to the SQL Server, and pull the
data
to the Access.

Link tables in an Access project by using the Link Table Wizard

http://office.microsoft.com/assistan...893711033&CTT=
1&Origin=EC010227041033&QueryID=Uao8zc53Y0&respos= 1&rt=2

Hope this will be helpful! If there are further questions on the issue,
please feel free to let us know.

Have a great day!


Sincerely yours,

Michael Cheng
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no
rights.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.