KBA-01140: Purge All Documents and Files from the Spitfire database

Purpose & Scope:

The test database has been configured with roles, users, default routes, etc. and now you‘d like to use the test database as the base for your live Spitfire database. The only problem is the test database has a lot of test Spitfire documents and files. How can these test Spitfire documents and files be purged from the database?


Purging all Spitfire Documents and Files from the Spitfire database is a two step process.

  1. Run the Purge All Docs and Files script in SQL Query Analyzer with output set to Text.
  2. Copy the text output of Step 1 to the SQL Query Analyzer window and execute.

Purge All Docs and Files script:

Set nocount on
SELECT ‘EXEC dbo.p_DeleteDocument ‘‘‘ + Cast(docmasterkey as varchar(44)) + ‘‘‘‘ from xsfDocHeader
SELECT ‘EXEC dbo.p_DeleteFile ‘‘‘ + Cast(dockey as varchar(44)) + ‘‘‘‘ from xsfFile

Additional Comments:

Warning:This process will permanently delete data from the database. Be sure to have a current backup of your database before you run the process.

KBA-01140; Last updated: October 12, 2016 at 8:48 am;
Keywords:  Delete