Re: Multiple DTS Packages -
08-15-2003
, 03:34 PM
To delete data from just certain tables then use the ExecuteSQL task. Are
these tables constant or changing ? If changing then pass them into SQL
Server through an INI file or DB table. You can thn read the values, split
them up and issue statements i.e
I know this table breaks all rules but example only
CREATE TABLE TablesToDelete (RunNr INT PRIMARY KEY, DateOfRun smalldatetime
, TableToDelete varchar(30))
INSERT TablesToDelete(RunNr, Tables)
VALUES(1,'authors','publishers','titles')
Using a Dynamic Properties task you can read this and assign to a variable.
Using the SPLIT() function you can then build a statement
The other way of doing the table is
CREATE TABLE TableToDelete (RunNr INT PRIMARY KEY , TableToDelete
varchar(30))
INSERT TablesToDelete(RunNr, TableToDelete) VALUES(1,'authors')
INSERT TablesToDelete(RunNr, TableToDelete) VALUES(1,'publishers')
INSERT TablesToDelete(RunNr, TableToDelete) VALUES(1,'titles')
You get the idea
--
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org |