Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Efficient Copy/Clone of SQL Server Databases?
Message
From
16/02/2016 13:25:39
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Efficient Copy/Clone of SQL Server Databases?
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows Server 2012 R2
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01631564
Message ID:
01631564
Views:
87
I'm working on a project that consolidates VFP data from 4 branch offices into a single SQL Server database. The overall process for each branch is:

1. Push the VFP data into a "SQLTemp" SQL Server database
2. Lightly data-munge and validate the above
3. If above is successful, copy everything from SQLTemp to a "SQLStaging" SQL Server database
4. TRUNCATE the SQLTemp DB

Above 4 steps are performed for all 4 branches.

If data for all 4 branches pass validation, then:

5. Everything in SQLStaging is copied to another "SQLProduction" SQL Server database.

All 3 SQL databases are identical, and live on the same SQL Server instance.

Are there simple and efficient commands or procedures to achieve 3) and 5) above?

3) is the equivalent of VFP APPEND FROM.

I've found one interesting and useful SQL Server stored procedure: sp_MSForEachTable. For instance, to TRUNCATE every table in a SQL Server database you can issue
EXEC sp_MSForEachTable 'TRUNCATE TABLE ?'
I'm wondering if something like that can make life easier.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Next
Reply
Map
View

Click here to load this message in the networking platform