I have some data
SELECT [field names] FROM [several joined tables] WHERE [some criteria is true]
and I would like to export this data to another database, keeping the table structure intact, but only populating them with the rows that fit the WHERE criteria.
So if I had 5 joined tables as the source, my resulting destination tables would also be 5. But they'd only be sparsely populated with the data that passes that WHERE clause constraint.
Even more briefly, I have a database full of customer data, and I'd like to send a stand alone database to a single customer, with only his/her records populated.
Some thoughts I had were to export the whole database, then delete all records where [criteria is not true] but I don't think the referential integrity of the database is such that all unwanted records would be purged.
Is there an easy or 'right' (aka SSIS) way to do this?