---
title: Troubleshoot SQL Server ingestion
description: Learn about common issues with the Microsoft SQL Server connector in Databricks Lakeflow Connect and how to resolve them.
canonical_url: https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sql-server-troubleshoot
---

# Troubleshoot SQL Server ingestion

This page describes common issues with the Microsoft SQL Server connector in Databricks Lakeflow Connect and how to resolve them.

For general troubleshooting guidance that applies to all managed ingestion pipelines, see [Troubleshoot managed ingestion pipelines](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/troubleshoot.md).

## Check if CDC is enabled for a database or a table

To check if CDC is enabled for database `<database-name>`:

```sql
select is_cdc_enabled from sys.databases where name='<database-name>';
```

To check if CDC is enabled for table `<schema-name>.<table-name>`:

```sql
select t.is_tracked_by_cdc
from sys.tables t join sys.schemas s on t.schema_id = s.schema_id
where s.name='<schema-name>' and t.name='<table-name>';
```

## Check if change tracking is enabled for a database or a table

To check if change tracking is enabled for database`\<database-name\>`:

```sql
select ctdb.*

from sys.change_tracking_databases ctdb join sys.databases db

    on db.database_id  = ctdb.database_id

where db.name = '<MyDatabaseName>'
```

To check if change tracking is enabled for table `<schema-name>.<table-name>`:

```sql
select s.name schema_name, t.name table_name, ct.*

from sys.change_tracking_tables ct join sys.tables t

    on ct.object_id = t.object_id

    join sys.schemas s on t.schema_id = s.schema_id

where s.name = '<MySchemaName>' and t.name = '<MyTableName>'
```

## Time out on waiting for table token

The ingestion pipeline might time out while waiting for information to be provided by the gateway. This might be because:

* You are running an older version of the gateway.
* There was an error generating the necessary information. Check the gateway driver logs for errors.

> [!NOTE]
>
> The full refresh flow significantly reduces the occurrence of timeout errors during full refresh operations. See [ Full refresh behavior (CDC)](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/full-refresh.md#cdc).

## default auth: cannot configure default credentials

If you receive this error, there is an issue with discovering the current user credentials. Try replacing the following:

```python
w = WorkspaceClient()
```

with:

```python
w = WorkspaceClient(host=input('Databricks Workspace URL: '), token=input('Token: '))
```

See [Authentication](https://databricks-sdk-py.readthedocs.io/en/stable/authentication.html) in the Databricks SDK for Python documentation.

## tech.replicant.common.ExtractorException: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'SERIAL\_NUMBER'.

You might receive this error if you're using an older version of an internal table. Run the following on the connected database:

```sql
drop table dbo.replicate_io_audit_ddl_trigger_1;
```

## PERMISSION\_DENIED: You are not authorized to create clusters. Please contact your administrator.

Contact a Databricks account admin to grant you `Unrestricted cluster creation` permissions.

## DLT ERROR CODE: INGESTION\_GATEWAY\_INTERNAL\_ERROR

Check the `stdout` file(s) in the driver logs.

## Source table naming conflict

```output
Ingestion pipeline error: "org.apache.spark.sql.catalyst.ExtendedAnalysisException: Cannot have multiple queries named `XYZ_snapshot_load` for `XYZ`. Additional queries on that table must be named. Note that unnamed queries default to the same name as the table.
```

This indicates that there is a name conflict due to multiple source tables named `XYZ` in different source schemas that are being ingested by the same ingestion pipeline to the same destination schema.

Create multiple gateway-pipeline pairs writing these conflicting tables to different destination schemas.

## Incompatible schema changes

An incompatible schema change causes the ingestion pipeline to fail with a `CDC_INCOMPATIBLE_SCHEMA_CHANGES` error. To continue replication, trigger a full refresh of the affected tables.

For example, adding a column with a `DEFAULT` constraint causes a `CDC_INCOMPATIBLE_SCHEMA_CHANGES.ADD_COLUMN_WITH_BACKFILL` error. See [Schema evolution](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sql-server-limits.md#schema-evolution).

> [!NOTE]
>
> Databricks can not guarantee that at time the ingestion pipeline fails for an incompatible schema change, all rows prior to the schema change have been ingested.

## NON\_INCREMENTAL\_SCHEMA\_CHANGE

```output
NON_INCREMENTAL_SCHEMA_CHANGE: Column '<column>' was added to table '<table>'. A full refresh is required to continue incremental ingestion.
```

This error occurs when a new column is added to a source table while incremental ingestion is active. The connector cannot backfill values for the new column from historical change data, so a full refresh is required.

Run a full refresh of the affected table to resume ingestion. See [Fully refresh target tables](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/full-refresh.md).

## MISSING\_TABLE\_IN\_SOURCE

```output
MISSING_TABLE_IN_SOURCE: Table '<schema>.<table>' could not be found in the source database.
```

This error occurs when a table that was previously available in the source database can no longer be found. Common causes include:

* The table was renamed or dropped in the source.
* The table is temporarily unavailable, for example during a maintenance window.

To resolve:

* If the table is temporarily unavailable, wait for maintenance to complete, then retry the pipeline.
* If the table was renamed or recreated, run a full refresh of the affected table.
* If the table was dropped intentionally, remove it from the pipeline.

## Large-object values are empty in the destination table

If a text or binary column is empty in the destination table but has a value in the source, the source value might be larger than the per-value size limit for large objects. The connector ingests oversized values as empty without failing the pipeline update or reporting an error, and you can't change this limit. See [Large-object size limit](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sql-server-limits.md#lob-size-limit).

## HTTP 403 errors accessing Azure storage

If your pipeline fails with an error like `INTERNAL_ERROR: Server returned HTTP response code: 403 for URL`, your compute might not have access to the Azure storage endpoint used by the SQL Server connector.

Run the following tests in a Databricks notebook to isolate the problem. Use `dbutils.secrets` to retrieve your shared access signature (SAS) token rather than hardcoding it.

### Test access to the DFS endpoint (ADLS Gen2)

The following snippet lists, reads, and writes to the Azure Data Lake Storage (ADLS) Gen2 endpoint, also called the Distributed File System (DFS) endpoint. Replace the placeholder values with your storage account, container, and secret details, then run it to confirm whether the SAS token can reach the DFS endpoint:

```python
storage_account = "<storage-account>"
container = "<container>"
sas_token = dbutils.secrets.get(scope="<scope>", key="<key>")

spark.conf.set(
    f"fs.azure.sas.{container}.{storage_account}.dfs.core.windows.net",
    sas_token
)

base_path = f"abfss://{container}@{storage_account}.dfs.core.windows.net/"

# List contents
display(dbutils.fs.ls(base_path))

# Read a file
df = spark.read.format("parquet").load(base_path + "<path-to-file>")
display(df.limit(10))

# Write a test file
df.write.format("delta").save(base_path + "_connectivity_test")
```

### Test access to the blob endpoint

If the DFS test succeeds but your pipeline still fails, the connector might be using the blob endpoint instead. The following snippet runs the same list, read, and write checks against the blob endpoint:

```python
storage_account = "<storage-account>"
container = "<container>"
sas_token = dbutils.secrets.get(scope="<scope>", key="<key>")

spark.conf.set(
    f"fs.azure.sas.{container}.{storage_account}.blob.core.windows.net",
    sas_token
)

base_path = f"wasbs://{container}@{storage_account}.blob.core.windows.net/"

# List files
display(dbutils.fs.ls(base_path))

# Read a file
df = spark.read.format("parquet").load(base_path + "<path-to-file>")
display(df.limit(10))

# Write a test file
df.write.format("delta").save(base_path + "_connectivity_test")
```

If either test returns a 403 error, the SAS token lacks the required permissions or does not cover the correct endpoint. Verify that the SAS token grants at least **Read** and **List** permissions on the container, and regenerate it if needed.

## TLS server certificate errors

For troubleshooting TLS server certificate validation errors, see [Troubleshoot TLS certificate errors](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/tls-server-certificate-validation.md#troubleshoot-tls-certificate-errors).
