Skip to content

Commit 4174dca

Browse files
Merge pull request #106582 from jiaqhuan/patch-2
Update get-started-connect-sqlcmd.md
2 parents d49e5e0 + 6983f47 commit 4174dca

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

articles/synapse-analytics/sql/get-started-connect-sqlcmd.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ You can use the [sqlcmd](/sql/tools/sqlcmd-utility?view=azure-sqldw-latest&prese
2525
## 1. Connect
2626
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:
2727

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)
2929
* **Database (-d):** Database name
3030
* **Enable Quoted Identifiers (-I):** Quoted identifiers must be enabled to connect to a Synapse SQL instance
3131

@@ -39,13 +39,13 @@ Your connection string might look like the following example:
3939
**Serverless SQL pool**
4040

4141
```sql
42-
C:\>sqlcmd -S partyeunrt.database.windows.net -d demo -U Enter_Your_Username_Here -P Enter_Your_Password_Here -I
42+
C:\>sqlcmd -S partyeunrt-ondemand.sql.azuresynapse.net -d demo -U Enter_Your_Username_Here -P Enter_Your_Password_Here -I
4343
```
4444

4545
**Dedicated SQL pool**
4646

4747
```
48-
C:\>sqlcmd -S MySqlDw.database.windows.net -d Adventure_Works -U myuser -P myP@ssword -I
48+
C:\>sqlcmd -S MySqlDw.sql.azuresynapse.net -d Adventure_Works -U myuser -P myP@ssword -I
4949
```
5050

5151
To use Azure Active Directory Integrated authentication, you need to add the Azure Active Directory parameters:
@@ -57,13 +57,13 @@ Your connection string might look like on of the following examples:
5757
**Serverless SQL pool**
5858

5959
```
60-
C:\>sqlcmd -S partyeunrt.database.windows.net -d demo -G -I
60+
C:\>sqlcmd -S partyeunrt-ondemand.sql.azuresynapse.net -d demo -G -I
6161
```
6262

6363
**Dedicated SQL pool**
6464

6565
```sql
66-
C:\>sqlcmd -S MySqlDw.database.windows.net -d Adventure_Works -G -I
66+
C:\>sqlcmd -S MySqlDw.sql.azuresynapse.net -d Adventure_Works -G -I
6767
```
6868

6969
> [!NOTE]
@@ -76,7 +76,7 @@ C:\>sqlcmd -S MySqlDw.database.windows.net -d Adventure_Works -G -I
7676
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:
7777

7878
```sql
79-
C:\>sqlcmd -S MySqlDw.database.windows.net -d Adventure_Works -U myuser -P myP@ssword -I
79+
C:\>sqlcmd -S MySqlDw.sql.azuresynapse.net -d Adventure_Works -U myuser -P myP@ssword -I
8080
1> SELECT name FROM sys.tables;
8181
2> GO
8282
3> QUIT
@@ -85,19 +85,19 @@ C:\>sqlcmd -S MySqlDw.database.windows.net -d Adventure_Works -U myuser -P myP@s
8585
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:
8686

8787
```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;"
8989
```
9090

9191
```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
9393
```
9494

9595
### Use serverless SQL pool
9696

9797
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:
9898

9999
```sql
100-
C:\>sqlcmd -S partyeunrt.database.windows.net -d demo -U Enter_Your_Username_Here -P Enter_Your_Password_Here -I
100+
C:\>sqlcmd -S partyeunrt-ondemand.sql.azuresynapse.net -d demo -U Enter_Your_Username_Here -P Enter_Your_Password_Here -I
101101
1> SELECT COUNT(*) FROM OPENROWSET(BULK 'https://azureopendatastorage.blob.core.windows.net/censusdatacontainer/release/us_population_county/year=20*/*.parquet', FORMAT='PARQUET')
102102
2> GO
103103
3> QUIT
@@ -106,11 +106,11 @@ C:\>sqlcmd -S partyeunrt.database.windows.net -d demo -U Enter_Your_Username_Her
106106
For serverless SQL pool, the examples that follow show you how to run queries in batch mode using the -Q option or piping your SQL to sqlcmd:
107107

108108
```sql
109-
sqlcmd -S partyeunrt.database.windows.net -d demo -U Enter_Your_Username_Here -P 'Enter_Your_Password_Here' -I -Q "SELECT COUNT(*) FROM OPENROWSET(BULK 'https://azureopendatastorage.blob.core.windows.net/censusdatacontainer/release/us_population_county/year=20*/*.parquet', FORMAT='PARQUET')"
109+
sqlcmd -S partyeunrt-ondemand.sql.azuresynapse.net -d demo -U Enter_Your_Username_Here -P 'Enter_Your_Password_Here' -I -Q "SELECT COUNT(*) FROM OPENROWSET(BULK 'https://azureopendatastorage.blob.core.windows.net/censusdatacontainer/release/us_population_county/year=20*/*.parquet', FORMAT='PARQUET')"
110110
```
111111

112112
```sql
113-
"SELECT COUNT(*) FROM OPENROWSET(BULK 'https://azureopendatastorage.blob.core.windows.net/censusdatacontainer/release/us_population_county/year=20*/*.parquet', FORMAT='PARQUET')" | sqlcmd -S partyeunrt.database.windows.net -d demo -U Enter_Your_Username_Here -P 'Enter_Your_Password_Here' -I > ./tables.out
113+
"SELECT COUNT(*) FROM OPENROWSET(BULK 'https://azureopendatastorage.blob.core.windows.net/censusdatacontainer/release/us_population_county/year=20*/*.parquet', FORMAT='PARQUET')" | sqlcmd -S partyeunrt-ondemand.sql.azuresynapse.net -d demo -U Enter_Your_Username_Here -P 'Enter_Your_Password_Here' -I > ./tables.out
114114
```
115115

116116
## Next steps

0 commit comments

Comments
 (0)