SYMPTOMS
Client wants to remove Bates Number information of a particular production.
CAUSE
Bates number information is created in LR database right after the production is started.
RESOLUTION
Perform the following steps to remove Bates Numbers for an individual production from a Matter in Legal Review:
1. To remove the production in question in the main Production table in the Legal Review database, run the following SQL query:
USE [DATABASE NAME]
DELETE FROM [dbo].[Production]
WHERE MatterId = [MATTER ID] and Name = [PRODUCTION NAME]
where
[DATABASE NAME] = Name of the Legal Review database
[MATTER ID] = Legal Review Matter ID
[PRODUCTION NAME] = Exact name of the production to be removed
2. To clean up the production tables that are relative to the production in the Legal Review database, run the following SQL query:
USE [DATABASE NAME]
DECLARE @ProdTable VARCHAR(100)
DECLARE @MultProdTable VARCHAR(100)
DECLARE @ConstrProdDictTable VARCHAR(100)
DECLARE @ConstrProdTable VARCHAR(100)
DECLARE @sql VARCHAR(8000)
SET @ProdTable = [PRODUCTION TABLE]
SET @MultProdTable = @ProdTable + '%MULTIV'
SET @ConstrProdDictTable = @ProdTable + '_' + @ProdTable
SET @ConstrProdTable = @ProdTable
SET @sql=''
SELECT @sql=@sql+' DROP TABLE '+ TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE @MultProdTable
EXEC(@sql)
SET @sql=''
SELECT @sql = @sql + ' ALTER TABLE ' + OBJECT_SCHEMA_NAME(parent_object_id) + '.[' + OBJECT_NAME(parent_object_id) + '] DROP CONSTRAINT ' + name FROM sys.foreign_keys
WHERE name LIKE '%' + @ConstrProdDictTable + '%' OR name LIKE '%' + @ConstrProdTable + '%'
EXEC(@sql)
SET @sql=''
SELECT @sql=@sql+' DROP TABLE '+ TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE @ProdTable + '%'
EXEC(@sql)
GO
where
[DATABASE NAME] = Name of the LR database
[PRODUCTION TABLE] = Name of the created production table
3. To remove production record in LR Production List view, navigate to 'Manage Existing Productions' in Legal Review and press [Remove] to remove the production.
NOTE: Database backups are strongly suggested before making any changes to the MS SQL database.
APPLIES TO
4.0
Comments
0 comments
Please sign in to leave a comment.