Difference between revisions of "CHECK DATABASE"

From Lianjapedia
Jump to: navigation, search
(Created page with "==Purpose== Checks the integrity of a database and all its tables, indexes and memo files. ==Syntax== CHECK DATABASE [<database name> [REPAIR]] ==See Also== ADATABASES()...")
 
 
Line 39: Line 39:
 
[[Category:Lianja VFP Extensions]]
 
[[Category:Lianja VFP Extensions]]
 
[[Category:VFP Command Extensions]]
 
[[Category:VFP Command Extensions]]
[[Category:Lianja v4.3]]
+
[[Category:Lianja v5.0]]

Latest revision as of 13:51, 1 March 2019

Purpose

Checks the integrity of a database and all its tables, indexes and memo files.

Syntax

CHECK DATABASE [<database name> [REPAIR]]

See Also

ADATABASES(), ADD TABLE, ALTER INDEX, ALTER TABLE, CHECK TABLE, CLOSE DATABASES, CLOSE TABLES, COMPILE DATABASE, COPY DATABASE, CREATE DATABASE, CREATE INDEX, CREATE TABLE, CREATE VIEW, DATABASE(), DBUSED(), DISPLAY DATABASE, DISPLAY INDEXES, DISPLAY SCHEMAS, DISPLAY TABLES, DROP DATABASE, DROP INDEX, DROP TABLE, GETENV(), INDEX, LIST DATABASE, LIST INDEXES, LIST SCHEMAS, LIST TABLES, OPEN DATABASE, PACK, PACK DATABASE, REBUILD DATABASE, REINDEX DATABASE, SET AUTOCATALOG, SET EXCLUSIVE, USE

Description

The CHECK DATABASE command checks the integrity of a database and all its tables, indexes and memo files.

If the optional REPAIR keyword is specified:

  • Any detected index errors are auto repaired.
  • Any detected duplicate links in memo files are unlinked.

The CHECK DATABASE command can be run on shared data.

After execution the "_tally" system variable is set to the number of errors detected.

Example

open database southwind
check database
if _tally > 0
  check database southwind repair
endif
close database
check database southwind
if _tally > 0
  check database southwind repair
endif