>Hello:
>
>Does anyone have code to iterate to all tables in a SQL Server database and issue a 'copy to (tablename).dbf?'
>
>
>TIA
You can not do copy to. You can do select * from ...
This should be simple.
1. Get a list of all tables using
select Table_Schema, Table_Name from INFORMATION_SCHEMA.Tables order by Table_Schema, Table_Name
2. Scan the cursor and create
select * from [<<Table_Schema>>].[<<Table_Name>>]
commands and run each command separately.
If it's not broken, fix it until it is.
My Blog