2008/8/2519:15 【VB.NET】SMOを利用してSQL Serverのサーバ一覧を取得する VB.NET等のプログラムからSQL Server 2005の管理(バックアップやリストア等)をプログラムで制御する場合、SMOを利用します。 今回は、このSMOを利用してネットワーク上にあるSQL Serverのサーバの一覧を取得する方法について説明します。 SMOを利用する場合、参照設定でライブラリを追加する必要があります。 サーバの一覧を取得するには、Microsoft.SqlServer.Management.smo.SmoApplication.EnumAvailableSqlServers()メソッドを利用します。 このメソッドは、以下の情報をDataTableの形式で返します。 ・Name(サーバ名+インスタンス名) ・Server(サーバ名) ・Instance(インス
「SQL Server Express」をバックアップするのは、面倒。 管理画面「SQL Server Management Studio」上からGUI操作でのバックアップはできるが、スケジューリングして毎日バックアップ、というようなことができない。以下のようにすると実現できる。 概要 「SQL Server Express」をコマンドラインから操作できるようにして、バッチ処理のタスクにする。 準備 「SQL Server Express」をコマンドライン操作するツールはsqlcmdでこれはmicrosoftからダウンロードできる。先に、同じURLからダウンロードできる「sql native client」のインストールが必要なことに注意。 「sql native client」と「sqlcmd」のインストール 「Microsoft SQL Server 2005 用 Feature Pa
あるテーブルに作成日時と更新日時があるとします。 で、こいつらを自動で更新する方法です。 作成日時の方はInsertが発生した際のみで登録するので、 こっちの方はCreate Tableの時に「DEFAULT (getdate())」を(MSSMSなら列のプロパティの規定値またはバインド)指定するだけ。 更新日時はトリガーを使います。(他に見つからない。。) でこんな感じでとりあえずうまく行ってます。 CREATE TRIGGER trUpdateDateTimeMemberInfo ON MemberInfo FOR UPDATE AS begin update MemberInfo set 更新日時 = GetDate() where MemberId = (select MemberId from inserted) end return サブクエリのinsertedっていうのは処理
SQL Server 2000では、管理ツール(SQL Server Enterprise Manager)からデータベースのインポート/エクスポート機能を使ってデータベースのコピーが行えた。また、SQL Server 2008などでは、同様の機能や、データベースのコピー機能が利用できるが、コマンドラインからも簡単に実行可能なデータベースのコピー・ツールがあるので紹介しよう。 SQL Server Database Copy Tool このツールは「SQL Server Database Copy Tool」という、名前のとおりのツールで、コピー元とコピー先のSQL Serverのデータベースを指定することで、簡単にデータベースのコピーが行える。インストールは不要で、ダウンロードしたファイルを展開すればすぐに使用できる。 このツールにはGUIとコマンドラインの2種類のUIがある。まずはGU
All Microsoft Global Microsoft 365 Teams Copilot Windows Surface Xbox Deals Small Business Support Software Windows Apps AI Outlook OneDrive Microsoft Teams OneNote Microsoft Edge Skype PCs & Devices Computers Shop Xbox Accessories VR & mixed reality Certified Refurbished Trade-in for cash Entertainment Xbox Game Pass Ultimate PC Game Pass Xbox games PC and Windows games Movies & TV Business Micro
Recommendations on how to design and develop custom applications using the Microsoft platform Each patterns & practices offering contains a combination of written documentation and re-usable source code. Many also include a reference implementation. As the guidance is being developed it is reviewed and approved by internal Microsoft product teams and by external customers and partners. This produc
適用対象: SQL Server 元の KB 番号: 4009936 SQL Server の接続の問題にはさまざまな原因があります。 この一連の記事では、最も一般的な SQL Server 接続の問題のトラブルシューティングと、トラブルシューティングに使用できるツールと方法について説明します。 注: 環境内の複数の SQL Server インスタンスが影響を受ける場合、または問題が断続的に発生する場合は、通常、Windows ポリシーまたはネットワークの問題を示しています。 この一連の記事ではガイダンスについて説明しますが、特定のシナリオを効果的にトラブルシューティングできない場合があります。 準備 トラブルシューティングを開始する前に、「接続の問題をトラブルシューティングするための推奨される前提条件とチェックリスト」を参照し、トラブルシューティングに役立てるために収集する必要のあるログ
名前付きパイプを使用した有効な接続文字列の作成Creating a Valid Connection String Using Named Pipes 06/13/2017 ユーザーが変更しない限り、のMicrosoftMicrosoft SQL ServerSQL Server既定のインスタンスは名前付きパイププロトコルをリッスンするとき\\.\pipe\sql\queryに、をパイプ名として使用します。Unless changed by the user, when the default instance of MicrosoftMicrosoft SQL ServerSQL Server listens on the named pipes protocol, it uses \\.\pipe\sql\query as the pipe name. ここで、ピリオドはコンピューター
連載目次 本連載ではVisual Basic 2005を活用したWindowsデータベース・アプリケーションのプログラミングについて解説を行っています。ここまで単一のテーブルのみを扱ってきましたが、今回そして次回では、一般に「マスタ/詳細テーブル」(あるいは親/子テーブル、Master/Detailテーブル)と呼ばれる、リレーションシップが設定された複数のテーブルを扱っていきます。 次の画面は今回で作成するサンプル・アプリケーションの実行時の画面です。画面の上部分では注文情報を、下部分でその注文に含まれる商品(注文明細情報)を表示しています。業務アプリケーションではおなじみの画面構成といえると思います。 それではさっそく、今回で使用するデータベースの準備から始めましょう。 Northwindデータベースの準備 前回では「Northwind and pubs Sample Databases
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く