yii\db\mssql\Schema::findTableNames PHP Method

findTableNames() protected method

Returns all table names in the database.
protected findTableNames ( string $schema = '' ) : array
$schema string the schema of the tables. Defaults to empty string, meaning the current or default schema.
return array all table names in the database. The names have NO schema name prefix.
    protected function findTableNames($schema = '')
    {
        if ($schema === '') {
            $schema = $this->defaultSchema;
        }
        $sql = <<<SQL
SELECT [t].[table_name]
FROM [INFORMATION_SCHEMA].[TABLES] AS [t]
WHERE [t].[table_schema] = :schema AND [t].[table_type] IN ('BASE TABLE', 'VIEW')
ORDER BY [t].[table_name]
SQL;
        return $this->db->createCommand($sql, [':schema' => $schema])->queryColumn();
    }