From a64a4e85ecf8677438371799e43d0210452ea9a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Jun 2026 19:11:24 +0000 Subject: [PATCH 1/3] Initial plan From 58e716148951271df76d4b3bf196aeb15cc920cd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Jun 2026 19:14:21 +0000 Subject: [PATCH 2/3] docs: clarify sqlcmd EOF troubleshooting --- docs/getting-started.md | 6 ++--- docs/index.html | 6 ++--- .../references/connect-and-query.md | 9 +++++--- .../references/troubleshooting.md | 23 +++++++++++++++++++ 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 0835a96..aded549 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -105,18 +105,18 @@ volumes: ### Step 3: connect and run your first query -You do not need to install anything: the container bundles sqlcmd, so this works for everyone. The `-C` flag trusts the container's self-signed certificate: +You do not need to install anything: the container bundles sqlcmd, so this works for everyone. Start with the bundled client and a short login timeout. If you started the container only seconds ago and see a transient startup failure such as `EOF`, wait a few seconds and rerun the same command. The `-C` flag trusts the container's self-signed certificate: ```bash docker exec sqldb /opt/mssql-tools18/bin/sqlcmd \ - -S localhost -U sa -P "YourStr0ng_Passw0rd" -C -Q "SELECT @@VERSION;" + -S localhost -U sa -P "YourStr0ng_Passw0rd" -C -b -l 2 -Q "SELECT @@VERSION;" ``` You should see `Microsoft SQL Azure`, confirming you are on the Azure SQL Database engine. **Other ways to query:** -- **Already have [sqlcmd](https://learn.microsoft.com/sql/tools/sqlcmd/sqlcmd-utility) on the host?** Connect directly: `sqlcmd -S localhost,1433 -U sa -P "YourStr0ng_Passw0rd" -C -Q "SELECT @@VERSION;"`. +- **Already have [sqlcmd](https://learn.microsoft.com/sql/tools/sqlcmd/sqlcmd-utility) on the host?** First wait for the in-container command above to succeed, then connect directly: `sqlcmd -S localhost,1433 -U sa -P "YourStr0ng_Passw0rd" -C -b -l 2 -Q "SELECT @@VERSION;"`. In PowerShell, retype the password quotes as plain ASCII `"` characters and do not include a leading space inside the password string. A pasted smart quote or extra space can cause an immediate `EOF`. - **Ask your AI agent, no T-SQL required.** With the [container skill](prerequisites.md#agent-skill) installed, ask in plain English, for example: *"Connect to my local Azure SQL Database and show the version and edition."* It already knows the connection details and runs the query for you. - **Use the VS Code MSSQL extension with GitHub Copilot.** Its [GitHub Copilot integration](https://aka.ms/vscode-mssql-copilot-docs) works against the container today, for example writing SQL from natural language or opening the schema designer. Connect with server `localhost,1433`, SQL Login, user `sa`, your password, and **Trust server certificate: Yes**. The extension's graphical UI is not yet fully compatible with the container, so some UI features may error; see [known limitations](known-limitations.md). diff --git a/docs/index.html b/docs/index.html index ee74783..0ef4af1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -190,11 +190,11 @@

Start the container

3

Connect and query

-

Open a session with sqlcmd and run your first query.

+

Use the bundled sqlcmd and run your first query. If the container just started, wait a few seconds and retry.

- $ sqlcmd -S localhost,1433 -U sa -C -h-1 \ + $ docker exec sqldb /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "YourStr0ng_Passw0rd" -C -b -l 2 \ -Q "SET NOCOUNT ON; SELECT @@VERSION AS Version;" - +
diff --git a/skills/azuresql-db-container/references/connect-and-query.md b/skills/azuresql-db-container/references/connect-and-query.md index 3e487d6..debed40 100644 --- a/skills/azuresql-db-container/references/connect-and-query.md +++ b/skills/azuresql-db-container/references/connect-and-query.md @@ -29,14 +29,17 @@ docker exec sqldb /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "YourStr0n ## sqlcmd from the host Use the host port chosen by the free-port loop (here shown as `1433`). The -comma form `localhost,PORT` selects the port. +comma form `localhost,PORT` selects the port. If the container just started, +wait for the in-container command above to succeed before using the host client. ```bash -sqlcmd -S localhost,1433 -U sa -P "YourStr0ng_Passw0rd" -C -b \ +sqlcmd -S localhost,1433 -U sa -P "YourStr0ng_Passw0rd" -C -b -l 2 \ -d appdb -Q "SELECT SERVERPROPERTY('Edition') AS Edition;" ``` -Expect `SQL Azure`. +Expect `SQL Azure`. In PowerShell, retype the password quotes as plain ASCII `"` +characters and make sure there is no leading space inside the password string. +A pasted smart quote or extra space can cause an immediate `EOF`. ## Standard connection string diff --git a/skills/azuresql-db-container/references/troubleshooting.md b/skills/azuresql-db-container/references/troubleshooting.md index 25bec33..3ed2686 100644 --- a/skills/azuresql-db-container/references/troubleshooting.md +++ b/skills/azuresql-db-container/references/troubleshooting.md @@ -11,6 +11,7 @@ Common failures and their fixes. Symptoms first. - Msg 40508 on USE - Cannot open database / database does not exist - Connecting too early (Msg 913 and friends) +- EOF from host sqlcmd - Wrong image (EngineEdition is not 5) ## Container won't start / exits immediately @@ -87,6 +88,28 @@ Errors right after `docker run` usually mean the engine is still initializing. Use the readiness retry loop with `-b -l 2` so transient errors are retried rather than masked. See `wait-until-ready.md`. +## EOF from host sqlcmd + +An immediate `EOF` from host `sqlcmd` usually means either the engine is still +starting or the shell changed the `-P` password argument while pasting it. + +First verify the container with the bundled client: + +```bash +docker exec sqldb /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "YourStr0ng_Passw0rd" -C -b -l 2 \ + -Q "SELECT 1;" +``` + +If that succeeds, retry from the host with the same short timeout: + +```bash +sqlcmd -S localhost,1433 -U sa -P "YourStr0ng_Passw0rd" -C -b -l 2 -Q "SELECT 1;" +``` + +In PowerShell, retype the password quotes as plain ASCII `"` characters and +make sure the password starts immediately after the opening quote. A pasted +smart quote or a leading space inside the password string can trigger `EOF`. + ## Wrong image (EngineEdition is not 5) If `SELECT SERVERPROPERTY('EngineEdition')` does not return `5`, or From 668b36d3aae76c9fe9ed689d0ab34a87f84c923f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Jun 2026 19:15:45 +0000 Subject: [PATCH 3/3] docs: refine sqlcmd EOF guidance --- docs/getting-started.md | 5 +++-- skills/azuresql-db-container/references/troubleshooting.md | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index aded549..775a8b6 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -105,7 +105,7 @@ volumes: ### Step 3: connect and run your first query -You do not need to install anything: the container bundles sqlcmd, so this works for everyone. Start with the bundled client and a short login timeout. If you started the container only seconds ago and see a transient startup failure such as `EOF`, wait a few seconds and rerun the same command. The `-C` flag trusts the container's self-signed certificate: +You do not need to install anything: the container bundles sqlcmd, so this works for everyone. Start with the bundled client and a short login timeout. If you started the container only seconds ago and see a transient startup failure such as `EOF`, wait a few seconds and rerun the same command. The `-C` flag trusts the container's self-signed certificate. ```bash docker exec sqldb /opt/mssql-tools18/bin/sqlcmd \ @@ -116,7 +116,8 @@ You should see `Microsoft SQL Azure`, confirming you are on the Azure SQL Databa **Other ways to query:** -- **Already have [sqlcmd](https://learn.microsoft.com/sql/tools/sqlcmd/sqlcmd-utility) on the host?** First wait for the in-container command above to succeed, then connect directly: `sqlcmd -S localhost,1433 -U sa -P "YourStr0ng_Passw0rd" -C -b -l 2 -Q "SELECT @@VERSION;"`. In PowerShell, retype the password quotes as plain ASCII `"` characters and do not include a leading space inside the password string. A pasted smart quote or extra space can cause an immediate `EOF`. +- **Already have [sqlcmd](https://learn.microsoft.com/sql/tools/sqlcmd/sqlcmd-utility) on the host?** First wait for the in-container command above to succeed, then connect directly: `sqlcmd -S localhost,1433 -U sa -P "YourStr0ng_Passw0rd" -C -b -l 2 -Q "SELECT @@VERSION;"`. + In PowerShell, retype the password quotes as plain ASCII `"` characters and do not include a leading space inside the password string. A pasted smart quote or extra space can cause an immediate `EOF`. - **Ask your AI agent, no T-SQL required.** With the [container skill](prerequisites.md#agent-skill) installed, ask in plain English, for example: *"Connect to my local Azure SQL Database and show the version and edition."* It already knows the connection details and runs the query for you. - **Use the VS Code MSSQL extension with GitHub Copilot.** Its [GitHub Copilot integration](https://aka.ms/vscode-mssql-copilot-docs) works against the container today, for example writing SQL from natural language or opening the schema designer. Connect with server `localhost,1433`, SQL Login, user `sa`, your password, and **Trust server certificate: Yes**. The extension's graphical UI is not yet fully compatible with the container, so some UI features may error; see [known limitations](known-limitations.md). diff --git a/skills/azuresql-db-container/references/troubleshooting.md b/skills/azuresql-db-container/references/troubleshooting.md index 3ed2686..50364d0 100644 --- a/skills/azuresql-db-container/references/troubleshooting.md +++ b/skills/azuresql-db-container/references/troubleshooting.md @@ -107,8 +107,8 @@ sqlcmd -S localhost,1433 -U sa -P "YourStr0ng_Passw0rd" -C -b -l 2 -Q "SELECT 1; ``` In PowerShell, retype the password quotes as plain ASCII `"` characters and -make sure the password starts immediately after the opening quote. A pasted -smart quote or a leading space inside the password string can trigger `EOF`. +make sure there is no leading space inside the password string. A pasted smart +quote or a leading space inside the password string can trigger `EOF`. ## Wrong image (EngineEdition is not 5)