Database troubleshooting

SQL Server gateway setup and troubleshooting

Diagnose SQL Server connection failures, invalid credentials, gateway reachability, table metadata issues, and V2 trigger requirements for Flow Migrator SQL actions.

SQL ServerFast

Use this guide when

  • Credentials are missing or not valid
  • SQL connection works in SSMS but fails through gateway
  • SQL Server localhost or named instance confusion
  • SQL created/modified triggers not firing

Prerequisites

  • A reachable SQL Server or SQL Server Express instance.
  • SQL Server Authentication or a Windows account that can be used by the connector.
  • TCP/IP enabled and a known SQL port, usually 1433 for the lab setup.
  • Tables used by Get row, Update row, and Delete row have a primary key.

Fast checks before you debug

  • If the gateway and SQL Server are on the same machine, localhost,1433 or 127.0.0.1,1433 can work.
  • If the gateway is on a different machine, do not use localhost; use the SQL Server machine name or IP address.
  • SQL Server Authentication requires Mixed Mode authentication.
  • SQL Server V2 created triggers require an IDENTITY column; modified triggers require a ROWVERSION column.

Step-by-step diagnostics

Verify the SQL port from the gateway host

Run this on the gateway machine. If the port fails, fix SQL Server TCP/IP, firewall, or the server name before creating the Power Automate connection.

Test-NetConnection <sql-server-name-or-ip> -Port 1433
Test the exact SQL login outside Power Automate

Use the same server, database, username, and password you will enter in Power Automate. A failed sqlcmd or SSMS login means the issue is still SQL authentication, not Flow Migrator.

sqlcmd -S tcp:<server>,1433 -d <database> -U <user> -P "<password>" -Q "SELECT SUSER_SNAME(), DB_NAME();"
Check SQL Server authentication mode

For SQL logins, SQL Server must be configured for SQL Server and Windows Authentication mode. After changing this setting, restart the SQL Server service.

Confirm trigger table requirements

For SQL Server V2 triggers, verify the schema before blaming the connector. The created trigger depends on an identity-style increasing key. The modified trigger depends on rowversion.

SELECT name, is_identity FROM sys.columns WHERE object_id = OBJECT_ID('dbo.YourTable');
SELECT name, system_type_id FROM sys.columns WHERE object_id = OBJECT_ID('dbo.YourTable') AND system_type_id = 189; -- rowversion/timestamp

Common errors and fixes

Credentials are missing or not valid.
Likely cause
Mixed Mode is off, the SQL login is disabled, the password is wrong, or the login is not mapped to the database.
Fix
Test the same credentials with sqlcmd from the gateway machine, then recreate or unlock the SQL login and database user.
The connection works with .\SQLEXPRESS but not localhost,1433.
Likely cause
The named instance is not listening on the fixed TCP port used by the connector.
Fix
Enable TCP/IP in SQL Server Configuration Manager and set IPAll TCP Port to 1433 or use the correct server/instance syntax if supported.
SQL trigger imports but never fires.
Likely cause
The source table does not meet SQL Server V2 trigger column requirements or the trigger state was created before test rows were added.
Fix
Confirm identity/rowversion requirements and update the trigger card or recreate the flow to reset trigger state.

Power Automate connection fields

FieldUse this value
Server namelocalhost,1433 only when SQL Server is on the gateway machine; otherwise use machine name or IP.
Database nameExact SQL database name, for example FlowMigratorSqlLab.
AuthenticationSQL Server Authentication is the simplest lab path; use a dedicated SQL login.
GatewayThe gateway machine that can reach the SQL Server host and port.

Validation checklist

  • Test-NetConnection succeeds from the gateway host.
  • sqlcmd or SSMS succeeds using the same credential that Power Automate uses.
  • Table dropdowns load or table names can be entered as custom values.
  • Primary key, identity, and rowversion requirements are confirmed where relevant.
  • Generated Flow Migrator SQL Server actions bind to the selected connection reference after import.

Related gateway guides