Use the procedure below to purge EFT Server data from your SQL database. If the database is active, you should delete the records in small "chunks," perhaps 1000 at a time, so that you do not affect the responsiveness of the SQL server for new/ongoing transactions. If you run script after hours or on a test system, you can delete all of the records in larger chunks.
A script is provided in EFT Server's SQL Server folder (by default, C:\Documents and Settings\All Users\Application Data\GlobalSCAPE\EFT Server Enterprise\SQL Server\PurgeSQLEFTData.sql; On Windows 2008, Application Data files for all users are in a hidden folder named %systemroot%\ProgramData instead of under Documents and Settings\All Users\Application Data.).
Anytime you edit a file, you should make a backup copy first.
To purge the data
Open the script in a text editor and edit the following values:
If the database name is not EFTDB, modify the following line with the name of the database: USE EFTDB.
All records BEFORE the "DeleteTo" date are affected. If you want all rows to be affected, edit the date and time to some time in the future:
SELECT @DeleteTo = '1/1/2007', @DeleteScope = '1000'
"DeleteScope" is the number of rows to be deleted and how quickly they are deleted. Leave the number of rows as '1000' or change it to another static value or a percentage of rows to be deleted.
SELECT @DeleteTo = '1/1/2007', @DeleteScope = '1000'
Examples are commented in the top of the script and shown below:
--SELECT @DeleteTo = '1/1/2006', @DeleteScope = '50%'
--SELECT @DeleteTo = '1/1/2007', @DeleteScope = '1000'
--SELECT @DeleteTo = '1/1/2007', @DeleteScope = '2000000000'
Save the script with a .sql extension. For example, save it as PurgeSQLEFTData.sql.
After you have edited and saved the script, you can craft the proper command line for "oSQL" to connect to the database. The example below assumes you have kept the same name for the file.
Open a command prompt. (Click Start > Run. Type cmd, then press ENTER.)
Type the following to execute the sql file:
[path to oSQL]\oSQL.exe -S [server address] -U [username] -P [password] -i "[path\to\PurgeSQLEftData.sql]\PurgeSQLEftData.sql"
For example, type:"C:\Program Files\Microsoft SQL Server\80\Tools\Binn\oSQL.exe" -S 192.168.19.17 -U iuser -P asd123!f$s1 -i "C:\Documents and Settings\All Users\Application Data\GlobalSCAPE\EFT Server Enterprise\SQL Server\PurgeSQLEftData.sql"
For additional information on the oSQL utility, including common script samples, refer to osql Utility on microsoft.com.