{"id":"d3067d8d23cd50d1","repo":"laravel/framework","slug":"schema-dumping-is-not-supported-when-using-sql-ser","errorCode":null,"errorMessage":"Schema dumping is not supported when using SQL Server.","messagePattern":"Schema dumping is not supported when using SQL Server\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Database/SqlServerConnection.php","lineNumber":154,"sourceCode":"     *\n     * @return \\Illuminate\\Database\\Schema\\Grammars\\SqlServerGrammar\n     */\n    protected function getDefaultSchemaGrammar()\n    {\n        return new SchemaGrammar($this);\n    }\n\n    /**\n     * Get the schema state for the connection.\n     *\n     * @param  \\Illuminate\\Filesystem\\Filesystem|null  $files\n     * @param  callable|null  $processFactory\n     *\n     * @throws \\RuntimeException\n     */\n    public function getSchemaState(?Filesystem $files = null, ?callable $processFactory = null)\n    {\n        throw new RuntimeException('Schema dumping is not supported when using SQL Server.');\n    }\n\n    /**\n     * Get the default post processor instance.\n     *\n     * @return \\Illuminate\\Database\\Query\\Processors\\SqlServerProcessor\n     */\n    protected function getDefaultPostProcessor()\n    {\n        return new SqlServerProcessor;\n    }\n}\n","sourceCodeStart":136,"sourceCodeEnd":167,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Database/SqlServerConnection.php#L136-L167","documentation":"SqlServerConnection.getSchemaState() unconditionally throws RuntimeException because SQL Server has no native schema-dump integration in Laravel (no equivalent of mysqldump/pg_dump wired into SqlServerSchemaState). Calling schema:dump or any code path that requests a connection's schema state on SQL Server hits this hard block.","triggerScenarios":"Running php artisan schema:dump against a SQL Server (DB_CONNECTION=sqlsrv) connection; a test/CI step that programmatically calls $connection->getSchemaState(); migrating from MySQL/Postgres to SQL Server without removing the schema-dump workflow.","commonSituations":"Apps migrated to SQL Server where schema:dump was part of CI; packages that assume schema dumping works on all drivers; misconfigured DB_CONNECTION env var.","solutions":["Do not run schema:dump on SQL Server — remove/skip that step in CI and scripts.","Use SQL Server's own tooling (sqlpackage / bcp / SSMS) for schema export/import instead.","Verify DB_CONNECTION is what you intend; if you expected MySQL/Postgres, fix the env.","Gate the schema:dump call behind a driver check: if (DB::getDriverName() !== 'sqlsrv') Artisan::call('schema:dump')."],"exampleFix":"// before\nArtisan::call('schema:dump');\n\n// after\nif (DB::getDriverName() !== 'sqlsrv') {\n    Artisan::call('schema:dump');\n}","handlingStrategy":"validation","validationCode":"if (DB::getDriverName() !== 'sqlsrv') {\n    Artisan::call('schema:dump');\n}","typeGuard":"function supportsSchemaDump(): bool\n{\n    return DB::getDriverName() !== 'sqlsrv';\n}","tryCatchPattern":null,"preventionTips":["Never call schema:dump on SQL Server — use sqlpackage/SSMS instead.","Driver-guard any CI step that dumps schemas.","Document that SQL Server is unsupported for schema:dump in project README."],"tags":["database","sql-server","schema-dump","unsupported-driver"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}