Hi, Im running MSFT SQL Server Mgmt Studio 2005 and would like to export all the tables in a DB where the # of rows > 0. I would like to export all tables to individual XLS files. I've gone through BCP documentation to no avail. Is there a simple code that can just export all tables in a database (with # rows > 0) to individual XLS files? It should be noted that the tables I want to output to XLS are created dynamically by a script. So, I wont know the table names until after running said script and the code I'm asking for in this post should not require one to know the table names.

Thank you in advance for all helpful responses! Please let me know if I need to be more clear in my request.

You can use SMO to look through each table in a given database and code SSIS to only export those that have a rowcount.

This kind of functionality is easy in theory but I'm not quite a SSIS ninja so it will take some work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.