次の方法で共有


Database.CheckAllocations Method

参照データベースのすべてのページをスキャンし、整合性を確保するためにページをテストします。

名前空間: Microsoft.SqlServer.Management.Smo
アセンブリ: Microsoft.SqlServer.Smo (microsoft.sqlserver.smo.dll 内)

構文

'宣言
Public Function CheckAllocations ( _
    repairType As RepairType _
) As StringCollection
public StringCollection CheckAllocations (
    RepairType repairType
)
public:
StringCollection^ CheckAllocations (
    RepairType repairType
)
public StringCollection CheckAllocations (
    RepairType repairType
)
public function CheckAllocations (
    repairType : RepairType
) : StringCollection

パラメータ

  • repairType
    修復オプションを示す RepairType オブジェクトの値です。

戻り値

データベース内の割り当てに関するレポートを含む StringCollection オブジェクトの値です。

解説

更新されたテキスト :2006 年 7 月 17 日

このメソッドは、Transact-SQL のDBCC CHECKALLLOC ステートメントと同等です。

この名前空間、クラス、またはメンバは、Microsoft .NET Framework Version 2.0 でのみサポートされています。

使用例

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Reference the AdventureWorks database.
Dim db As Database
db = srv.Databases("AdventureWorks")
'Note, to use the StringCollection type the System.Collections.Specialized system namespace must be included in the imports statements.
Dim sc As StringCollection
'Run the CheckTables method and display the results from the returned StringCollection variable.
sc = db.CheckTables(RepairType.None)
Dim c As Integer
For c = 0 To sc.Count - 1
    Console.WriteLine(sc.Item(c))
Next

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

Database Class
Database Members
Microsoft.SqlServer.Management.Smo Namespace

その他の技術情報

Visual Basic .NET でデータベースの整合性確認を実行する方法
Visual Basic .NET でデータベースを作成、変更、および削除する方法
DBCC CHECKALLOC (Transact-SQL)
データベースの作成、変更、および削除
CREATE DATABASE (Transact-SQL)

変更履歴

リリース

履歴

2006 年 7 月 17 日

変更内容 :
  • 「解説」セクションに説明を追加しました。

  • 「例」セクションにコードを追加しました。