Not
Bu sayfaya erişim yetkilendirme gerektiriyor. Oturum açmayı veya dizinleri değiştirmeyi deneyebilirsiniz.
Bu sayfaya erişim yetkilendirme gerektiriyor. Dizinleri değiştirmeyi deneyebilirsiniz.
Use the [sqlcmd][sqlcmd] command-line utility to connect to and query a dedicated SQL pool.
1. Bağlan
To get started with [sqlcmd][sqlcmd], open the command prompt and enter sqlcmd followed by the connection string for your dedicated SQL pool. Bağlantı dizesi aşağıdaki parametreleri gerektirir:
-
Server (-S): Server in the form
<Server Name>.database.windows.net - Database (-d): dedicated SQL pool name.
- Enable Quoted Identifiers (-I): Quoted identifiers must be enabled to connect to a dedicated SQL pool instance.
To use SQL Server Authentication, you need to add the username/password parameters:
-
User (-U): Server user in the form
<User> - Password (-P): Password associated with the user.
For example, your connection string might look like the following:
C:\>sqlcmd -S MySqlDw.database.windows.net -d Adventure_Works -U myuser -P myP@ssword -I
Microsoft Entra tümleşik kimlik doğrulamasını kullanmak için Microsoft Entra parametrelerini eklemeniz gerekir:
- Microsoft Entra kimlik doğrulaması (-G): Kimlik doğrulaması için Microsoft Entra Id kullanın
For example, your connection string might look like the following:
C:\>sqlcmd -S MySqlDw.database.windows.net -d Adventure_Works -G -I
Uyarı
You need to enable Microsoft Entra authentication to authenticate using Microsoft Entra ID.
2. Query
After connection, you can issue any supported Transact-SQL statements against the instance. In this example, queries are submitted in interactive mode.
C:\>sqlcmd -S MySqlDw.database.windows.net -d Adventure_Works -U myuser -P myP@ssword -I
1> SELECT name FROM sys.tables;
2> GO
3> QUIT
These next examples show how you can run your queries in batch mode using the -Q option or piping your SQL to sqlcmd.
sqlcmd -S MySqlDw.database.windows.net -d Adventure_Works -U myuser -P myP@ssword -I -Q "SELECT name FROM sys.tables;"
"SELECT name FROM sys.tables;" | sqlcmd -S MySqlDw.database.windows.net -d Adventure_Works -U myuser -P myP@ssword -I > .\tables.out
Sonraki adımlar
For more about details about the options available in sqlcmd, see sqlcmd documentation.