You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
You are viewing the article in preview mode. It is not live at the moment.
Welcome to the CAREWare FAQ Page
Home > Database Administration > Maintenance Query
Maintenance Query
print icon

The following query can improve CAREWare performance. This query may take time to run, up to 20 minutes.  During that time CAREWare performance may diminish due to resources in SQL being devoted to the task. It may be best to complete this query outside of regular work hours.

 

USE cw_data
DECLARE @TableName varchar(255)
DECLARE TableCursor CURSOR FOR SELECT table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE'
OPEN TableCursor FETCH NEXT FROM TableCursor INTO @TableName WHILE @@FETCH_STATUS = 0 BEGIN DBCC DBREINDEX(@TableName,'',90) FETCH NEXT FROM TableCursor INTO @TableName END
CLOSE TableCursor DEALLOCATE TableCursor 

Feedback
0 out of 0 found this helpful

scroll to top icon