それでは、SMOを使用してデータベースの作成を行ってみることにしよう。まず、SQL Server Management Studioから「データベース」を右クリックして「PowerShellの起動」をクリックする。すると「Databases」フォルダからPowerShellが起動するので、以下のコマンドを実行 ...
他にも、PowerShellで可能な処理をいくつか見ていこう。まずはSMOを使用した少し複雑な例として、インデックスを作成してみよう。まず、SQL Server Management Studioで「インデックス」を右クリックし、「PowerShellの起動」をクリックする。 SMOを使用して ...
SQL Server 製品版では、定期的なバックアップをメンテナンスプランで構成することが多いと思います。 BACKUP DATABASE コマンドの出力先に共有フォルダを指定することも可能ではありますが、SQL Server 実行ユーザーに権限が必要ですし、ローカルにバックアップ ...
Sometimes you become the accidental DBA, or you are the DBA by choice. Either way, you can choose to spend time working in SQL Server Management Studio (SSMS) to look at things such as backups or the ...
Introduction Automating the installation of SQL Server using PowerShell can simplify the deployment process, particularly in environments where multiple instances are needed. This guide provides a ...
When I (along with many other people) had a lot of trouble trying to install SQL Server Management Studio in an attempt to switch from the SQL Server 2008 R2 evaluation to the free Express version, I ...
Vibe coded with minor human intervention using Windsurf AI and Claude 3.7 Sonnet. To set up a scheduled task to run the script daily: Open Task Scheduler. Create a new task. Set the trigger to run ...
In a previous article, I talked about getting started with managing SQL server using PowerShell and the Server Management Objects (SMO). While that was mostly spent making the connection and doing ...