views:

291

answers:

1

How would I Populate a DataSet with ALL the Tables from a SQLCE DB. Is this possible in ONE SQL select statement?

I know that I can call seperate select statements with the names of the table I need data from but I need a generic solution that just dumps all the tables from the SQLCE DB into a Dataset.

Thanks

+1  A: 
SELECT 'SELECT * FROM ' + TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
  1. Run it to get all the queries.
  2. Run each query, dumping it in the same dataset.

This works very easy.

Edit: I think I also had problems trying to run multiple queries in a single go with SQL CE (even with the line terminator ;).

leppie
THANKS! That was quick. Interesting Solution
Zion