1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Invoke-Sqlcmdを使う

Posted at

Powershellのオブジェクトとして各パーツを扱えるので便利な模様

モジュールインストール

Install-Module -Name SqlServer

クエリ実行

Invoke-Sqlcmd  -ServerInstance "test.database.windows.net" -Database "test" -Username "user" -Password "password" -Query "select @@version"

実行結果

Column1
-------
Microsoft SQL Azure (RTM) - 12.0.2000.8 ...
1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?