You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/synapse-analytics/sql/get-started-connect-sqlcmd.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ You can use the [sqlcmd](/sql/tools/sqlcmd-utility?view=azure-sqldw-latest&prese
25
25
## 1. Connect
26
26
To get started with [sqlcmd](/sql/tools/sqlcmd-utility?view=azure-sqldw-latest&preserve-view=true), open the command prompt and enter **sqlcmd** followed by the connection string for your Synapse SQL database. The connection string requires the following parameters:
27
27
28
-
***Server (-S):** Server in the form `<`Server Name`>`.database.windows.net
28
+
***Server (-S):** Server in the form `<`Server Name`>`-ondemand.sql.azuresynapse.net(Serverless SQL pool) or `<`Server Name`>`.sql.azuresynapse.net(Dedicated SQL pool)
29
29
***Database (-d):** Database name
30
30
***Enable Quoted Identifiers (-I):** Quoted identifiers must be enabled to connect to a Synapse SQL instance
31
31
@@ -39,13 +39,13 @@ Your connection string might look like the following example:
After connection, you can issue any supported [Transact-SQL](/sql/t-sql/language-reference?view=azure-sqldw-latest&preserve-view=true) (T-SQL) statements against the instance. In this example, queries are submitted in interactive mode:
For dedicated SQL pool, the following examples show you how to run queries in batch mode using the -Q option or piping your SQL to sqlcmd:
86
86
87
87
```sql
88
-
sqlcmd -S MySqlDw.database.windows.net-d Adventure_Works -U myuser -P myP@ssword -I -Q "SELECT name FROM sys.tables;"
88
+
sqlcmd -S MySqlDw.sql.azuresynapse.net-d Adventure_Works -U myuser -P myP@ssword -I -Q "SELECT name FROM sys.tables;"
89
89
```
90
90
91
91
```sql
92
-
"SELECT name FROM sys.tables;" | sqlcmd -S MySqlDw.database.windows.net-d Adventure_Works -U myuser -P myP@ssword -I > .\tables.out
92
+
"SELECT name FROM sys.tables;" | sqlcmd -S MySqlDw.sql.azuresynapse.net-d Adventure_Works -U myuser -P myP@ssword -I > .\tables.out
93
93
```
94
94
95
95
### Use serverless SQL pool
96
96
97
97
After connecting, you can issue any supported [Transact-SQL](/sql/t-sql/language-reference?view=azure-sqldw-latest&preserve-view=true) (T-SQL) statements against the instance. In the following example, queries are submitted in interactive mode:
1>SELECTCOUNT(*) FROM OPENROWSET(BULK 'https://azureopendatastorage.blob.core.windows.net/censusdatacontainer/release/us_population_county/year=20*/*.parquet', FORMAT='PARQUET')
0 commit comments