"No","テストID","対象ファイル","対象クラス/関数","対象メソッド","テスト観点","テストケース名","前提条件","入力値","期待結果","優先度","備考"
"1","UT-BWH-001","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","デフォルトパラメータで実行中クエリ一覧が取得できること","SQL Server接続済み、アクティブなクエリが存在","全パラメータデフォルト","実行中クエリの一覧が返却される（run_date, elapsed_time, session_id等のカラムを含む結果セット）","高","基本機能の確認"
"2","UT-BWH-002","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@Help=1でヘルプ情報が表示されること","SQL Server接続済み","@Help=1","sp_BlitzWhoの使用方法、制限事項、MITライセンス情報がPRINT出力される","中","ヘルプ機能の確認"
"3","UT-BWH-003","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@VersionCheckMode=1でバージョン情報のみが返却されること","SQL Server接続済み","@VersionCheckMode=1, @Version OUTPUT, @VersionDate OUTPUT","@Version='8.29', @VersionDate='20260203'が出力パラメータに設定され、即座にRETURNする","中","バージョンチェックモード"
"4","UT-BWH-004","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@ShowSleepingSPIDs=0でスリープ中のSPIDが除外されること","スリープ中のセッションが存在","@ShowSleepingSPIDs=0","database_nameがNULLでないセッションのみが返却される","高","スリープセッションのフィルタリング"
"5","UT-BWH-005","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@ShowSleepingSPIDs=1でオープントランザクションを持つスリープセッションが表示されること","オープントランザクションを持つスリープセッションが存在","@ShowSleepingSPIDs=1","スリープ中でもopen_transaction_count >= 1のセッションが結果に含まれる","高","トランザクション保持セッションの表示"
"6","UT-BWH-006","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@ShowSleepingSPIDs=2で全てのスリープセッションが表示されること","スリープ中のセッションが存在","@ShowSleepingSPIDs=2","スリープ状態のセッションを含む全てのユーザーセッションが返却される","中","全セッション表示モード"
"7","UT-BWH-007","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@ExpertMode=1で追加の詳細カラムが返却されること","SQL Server接続済み、アクティブなクエリが存在","@ExpertMode=1","fix_parameter_sniffing, client_interface_name, login_time, request_cpu_time等の詳細カラムが結果に含まれる","高","エキスパートモードの詳細情報"
"8","UT-BWH-008","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@Debug=1でSQL文がPRINT出力されること","SQL Server接続済み","@Debug=1","実行されるSQL文（@StringToExecute）がPRINTで出力される","低","デバッグ機能の確認"
"9","UT-BWH-009","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","出力テーブルが指定された場合にテーブルが作成されること","指定データベース・スキーマが存在、出力テーブルは未作成","@OutputDatabaseName='TestDB', @OutputSchemaName='dbo', @OutputTableName='BlitzWhoResults'","出力テーブルが作成され、結果がINSERTされる","高","テーブル出力機能"
"10","UT-BWH-010","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","既存の出力テーブルに結果が追記されること","出力テーブルが既に存在","@OutputDatabaseName='TestDB', @OutputSchemaName='dbo', @OutputTableName='BlitzWhoResults'","既存テーブルに新しいレコードがINSERTされる","高","テーブルへの追記"
"11","UT-BWH-011","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@OutputTableRetentionDaysで古いデータが削除されること","出力テーブルに4日以上前のデータが存在","@OutputTableRetentionDays=3","CheckDateが3日より前のレコードが削除される","中","データ保持期間の制御"
"12","UT-BWH-012","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@MinElapsedSecondsで経過時間フィルタが適用されること","様々な実行時間のクエリが存在","@MinElapsedSeconds=10","total_elapsed_timeが10秒以上のクエリのみが返却される","高","経過時間フィルタリング"
"13","UT-BWH-013","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@MinCPUTimeでCPU時間フィルタが適用されること","様々なCPU時間のクエリが存在","@MinCPUTime=5000","cpu_timeが5000ms以上のクエリのみが返却される","高","CPU時間フィルタリング"
"14","UT-BWH-014","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@MinLogicalReadsで論理読取りフィルタが適用されること","様々な論理読取り数のクエリが存在","@MinLogicalReads=10000","logical_readsが10000以上のクエリのみが返却される","高","論理読取りフィルタリング"
"15","UT-BWH-015","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@MinPhysicalReadsで物理読取りフィルタが適用されること","様々な物理読取り数のクエリが存在","@MinPhysicalReads=1000","physical_readsが1000以上のクエリのみが返却される","中","物理読取りフィルタリング"
"16","UT-BWH-016","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@MinWritesで書込みフィルタが適用されること","様々な書込み数のクエリが存在","@MinWrites=500","writesが500以上のクエリのみが返却される","中","書込みフィルタリング"
"17","UT-BWH-017","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@MinTempdbMBでtempdb使用量フィルタが適用されること","様々なtempdb使用量のクエリが存在","@MinTempdbMB=100","tempdb_allocations_mbが100MB以上のクエリのみが返却される","中","tempdb使用量フィルタリング"
"18","UT-BWH-018","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@MinRequestedMemoryKBでメモリ要求フィルタが適用されること","様々なメモリ要求量のクエリが存在","@MinRequestedMemoryKB=10240","requested_memory_kbが10240KB以上のクエリのみが返却される","中","メモリ要求フィルタリング"
"19","UT-BWH-019","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@MinBlockingSecondsでブロッキング時間フィルタが適用されること","ブロッキングが発生中","@MinBlockingSeconds=5","ブロッキング合計時間が5秒以上の場合に全関連クエリが返却される","高","ブロッキングフィルタリング"
"20","UT-BWH-020","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@SortOrder='elapsed time'で経過時間順にソートされること","複数のアクティブクエリが存在","@SortOrder='elapsed time'","結果がelapsed_timeの降順でソートされる","中","ソート順序：経過時間"
"21","UT-BWH-021","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@SortOrder='session_id'でセッションID順にソートされること","複数のアクティブクエリが存在","@SortOrder='session_id'","結果がsession_idの降順でソートされる","中","ソート順序：セッションID"
"22","UT-BWH-022","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@SortOrder='query_cost'でクエリコスト順にソートされること","複数のアクティブクエリが存在","@SortOrder='query_cost'","結果がquery_costの降順でソートされる","中","ソート順序：クエリコスト"
"23","UT-BWH-023","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@SortOrder='database_name'でデータベース名順にソートされること","複数のアクティブクエリが存在","@SortOrder='database_name'","結果がdatabase_nameの昇順でソートされる","低","ソート順序：データベース名"
"24","UT-BWH-024","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@SortOrder='login_name'でログイン名順にソートされること","複数のアクティブクエリが存在","@SortOrder='login_name'","結果がlogin_nameの昇順でソートされる","低","ソート順序：ログイン名"
"25","UT-BWH-025","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@SortOrder='request_cpu_time'でリクエストCPU時間順にソートされること","複数のアクティブクエリが存在","@SortOrder='request_cpu_time'","結果がrequest_cpu_timeの降順でソートされる","低","ソート順序：リクエストCPU時間"
"26","UT-BWH-026","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@GetLiveQueryPlan=1でライブクエリプランが取得されること","SQL Server 2016以降、実行中クエリが存在","@GetLiveQueryPlan=1","live_query_planカラムにXML形式のクエリプランが含まれる","高","ライブクエリプラン取得"
"27","UT-BWH-027","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@GetLiveQueryPlan=0でライブクエリプランが取得されないこと","SQL Server接続済み","@GetLiveQueryPlan=0","live_query_planカラムに「Live Query Plans were not retrieved」メッセージが含まれる","中","ライブクエリプラン無効化"
"28","UT-BWH-028","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@ShowActualParameters=1でライブパラメータ情報が表示されること","SQL Server 2012以降、パラメータ化クエリが実行中","@ShowActualParameters=1, @GetLiveQueryPlan=1","Live_Parameter_Infoカラムに実行時パラメータ値が含まれる","中","ライブパラメータ表示"
"29","UT-BWH-029","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@GetOuterCommand=1で外部コマンドが取得されること","SQL Server接続済み、ストアドプロシージャ内のクエリが実行中","@GetOuterCommand=1","outer_commandカラムに呼び出し元のコマンドが含まれる","中","外部コマンド取得"
"30","UT-BWH-030","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","@CheckDateOverrideで日時が上書きされること","出力テーブルが設定済み","@OutputDatabaseName='TestDB', @OutputSchemaName='dbo', @OutputTableName='Results', @CheckDateOverride='2024-01-01 12:00:00'","CheckDateカラムに指定した日時が設定される","低","日時上書き機能"
"31","UT-BWH-031","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","ブロッキングチェーン情報が正しく取得されること","セッションAがセッションBをブロック中","デフォルト","blocking_session_idにブロック元セッションIDが表示される","高","ブロッキング検出"
"32","UT-BWH-032","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","待機情報が正しく取得されること","待機中のクエリが存在","デフォルト","wait_infoカラムに待機タイプと待機時間が表示される","高","待機情報表示"
"33","UT-BWH-033","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","クエリテキストが正しく抽出されること","複数ステートメントのバッチが実行中","デフォルト","query_textカラムに現在実行中のステートメントのみが抽出される","高","クエリテキスト抽出"
"34","UT-BWH-034","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","クエリプランが取得されること","実行プランが存在するクエリが実行中","デフォルト","query_planカラムにXML形式の実行プランが含まれる","高","クエリプラン取得"
"35","UT-BWH-035","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","tempdb割当量が正しく計算されること","tempdbを使用するクエリが実行中","@ExpertMode=1","tempdb_allocations_mbカラムにMB単位の使用量が表示される","中","tempdb使用量計算"
"36","UT-BWH-036","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","トランザクション分離レベルが正しく表示されること","様々な分離レベルのトランザクションが実行中","@ExpertMode=1","transaction_isolation_levelカラムに適切な分離レベル名が表示される","中","分離レベル表示"
"37","UT-BWH-037","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","暗黙トランザクションが検出されること","暗黙トランザクションモードのセッションが存在","デフォルト","is_implicit_transactionカラムが1で返却される","中","暗黙トランザクション検出"
"38","UT-BWH-038","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","メモリグラント情報が表示されること","メモリグラントを待機中のクエリが存在","@ExpertMode=1","requested_memory_kb, grant_memory_kb等のカラムに値が設定される","中","メモリグラント情報"
"39","UT-BWH-039","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","Resource Governor情報が表示されること","Resource Governorが有効","@ExpertMode=1","workload_group_name, resource_pool_nameカラムに値が設定される","低","Resource Governor情報"
"40","UT-BWH-040","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","SQLジョブ名がprogram_nameに表示されること","SQL Agentジョブが実行中","デフォルト","program_nameカラムにジョブ名が含まれる形式で表示される","中","SQLジョブ名解決"
"41","UT-BWH-041","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","Deltaビューが作成されること","出力テーブルが設定済み、ビューが未作成","@OutputDatabaseName='TestDB', @OutputSchemaName='dbo', @OutputTableName='Results'","BlitzWho_Deltasビューが作成される","中","Deltaビュー作成"
"42","UT-BWH-042","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","セッションウェイト情報が表示されること（SQL Server 2016以降）","SQL Server 2016以降","デフォルト","top_session_waitsカラムにトップ5の待機タイプと時間が表示される","中","セッションウェイト情報"
"43","UT-BWH-043","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","クエリ統計情報（DOP、メモリ）が表示されること（SQL Server 2012以降）","SQL Server 2012 SP3以降","@ExpertMode=1","last_dop, min_dop, max_dop, last_grant_kb等のカラムに値が設定される","中","拡張クエリ統計"
"44","UT-BWH-044","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","キャッシュパラメータ情報が表示されること","パラメータ化クエリが実行中","デフォルト","Cached_Parameter_Infoカラムにコンパイル時パラメータ値が含まれる","中","キャッシュパラメータ情報"
"45","UT-BWH-045","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","fix_parameter_sniffingコマンドが生成されること","実行プランが存在するクエリが実行中","@ExpertMode=1","fix_parameter_sniffingカラムにDBCC FREEPROCCACHEコマンドが含まれる","中","パラメータスニッフィング対策"
"46","UT-BWH-046","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","HADRレプリカのREAD_ONLYデータベースが除外されること","可用性グループのセカンダリレプリカで実行","デフォルト","セカンダリレプリカでREAD_ONLY接続のデータベースは結果から除外される","中","HADRレプリカ対応"
"47","UT-BWH-047","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","Azure SQL Databaseで実行できること","Azure SQL Database環境","デフォルト","結果が返却される（一部機能は制限される場合がある）","高","Azure SQL Database対応"
"48","UT-BWH-048","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","50GB以上のメモリ環境でMAX_GRANT_PERCENTヒントが付与されること","サーバーメモリが50GB以上","デフォルト","実行SQLにMAX_GRANT_PERCENT=1ヒントが含まれる","低","大規模メモリ環境対応"
"49","UT-BWH-049","sp_BlitzWho.sql","sp_BlitzWho","(main)","境界値","@ShowSleepingSPIDsの境界値0","SQL Server接続済み","@ShowSleepingSPIDs=0","スリープセッションが除外される","高","ShowSleepingSPIDsの最小値"
"50","UT-BWH-050","sp_BlitzWho.sql","sp_BlitzWho","(main)","境界値","@ShowSleepingSPIDsの境界値2","SQL Server接続済み","@ShowSleepingSPIDs=2","全セッションが表示される","中","ShowSleepingSPIDsの最大値"
"51","UT-BWH-051","sp_BlitzWho.sql","sp_BlitzWho","(main)","境界値","@MinElapsedSecondsが0の場合","SQL Server接続済み","@MinElapsedSeconds=0","フィルタが適用されず全てのクエリが返却される","高","MinElapsedSecondsの最小値"
"52","UT-BWH-052","sp_BlitzWho.sql","sp_BlitzWho","(main)","境界値","@OutputTableRetentionDaysの最小値","出力テーブルが存在","@OutputTableRetentionDays=0","当日以外のデータが全て削除される","中","OutputTableRetentionDaysの最小値"
"53","UT-BWH-053","sp_BlitzWho.sql","sp_BlitzWho","(main)","境界値","@OutputTableRetentionDaysの最大値（TINYINT）","出力テーブルが存在","@OutputTableRetentionDays=255","255日以上前のデータのみ削除される","低","OutputTableRetentionDaysの最大値"
"54","UT-BWH-054","sp_BlitzWho.sql","sp_BlitzWho","(main)","境界値","実行中クエリが0件の場合","アクティブなクエリが存在しない","デフォルト","空の結果セットが返却される","高","クエリ0件"
"55","UT-BWH-055","sp_BlitzWho.sql","sp_BlitzWho","(main)","境界値","大量のセッションが存在する場合","1000以上のアクティブセッション","デフォルト","全セッションの情報が返却される（パフォーマンス確認）","中","大量セッション"
"56","UT-BWH-056","sp_BlitzWho.sql","sp_BlitzWho","(main)","異常系","@OutputDatabaseNameに存在しないデータベースが指定された場合","指定データベースが存在しない","@OutputDatabaseName='NonExistentDB', @OutputSchemaName='dbo', @OutputTableName='Results'","テーブル出力処理がスキップされ、通常のSELECT結果が返却される","高","存在しないDB指定"
"57","UT-BWH-057","sp_BlitzWho.sql","sp_BlitzWho","(main)","異常系","@OutputSchemaNameにNULLが指定された場合","出力テーブル名のみ指定","@OutputTableName='Results', @OutputDatabaseName=NULL, @OutputSchemaName=NULL","Azure SQL DBでは現在のDB/スキーマが使用される、そうでなければ処理スキップ","中","NULL Schema指定"
"58","UT-BWH-058","sp_BlitzWho.sql","sp_BlitzWho","(main)","異常系","@SortOrderに不正な値が指定された場合","SQL Server接続済み","@SortOrder='invalid_column'","デフォルトのelapsed time順でソートされる","中","不正SortOrder"
"59","UT-BWH-059","sp_BlitzWho.sql","sp_BlitzWho","(main)","異常系","自身のセッションが結果に含まれないこと","SQL Server接続済み","デフォルト","sp_BlitzWhoを実行しているセッション自体は結果に含まれない（@@SPID除外）","高","自セッション除外"
"60","UT-BWH-060","sp_BlitzWho.sql","sp_BlitzWho","(main)","異常系","host_nameがNULLのセッションが除外されること","システムセッションが存在","デフォルト","host_nameがNULLのセッションは結果に含まれない","中","システムセッション除外"
"61","UT-BWH-061","sp_BlitzWho.sql","sp_BlitzWho","(main)","異常系","SQL Server 2008 R2以前で実行された場合","SQL Server 2008 R2環境","デフォルト","一部機能（ライブクエリプラン等）が利用不可、基本機能は動作","中","旧バージョン互換性"
"62","UT-BWH-062","sp_BlitzWho.sql","sp_BlitzWho","(main)","異常系","@GetLiveQueryPlanで権限エラーが発生する場合","VIEW SERVER STATE権限なし","@GetLiveQueryPlan=1","適切なエラーメッセージまたは権限なしでの処理継続","中","権限エラー対応"
"63","UT-BWH-063","sp_BlitzWho.sql","sp_BlitzWho","(main)","異常系","ロック待機によるタイムアウト","ロック競合が発生中","デフォルト","LOCK_TIMEOUT 1000msでタイムアウトし、取得可能な情報のみ返却","中","ロックタイムアウト対応"
"64","UT-BWH-064","sp_BlitzWho.sql","sp_BlitzWho","(main)","状態","出力テーブルにJoinKeyカラムが存在しない場合","古い形式の出力テーブルが存在","@OutputDatabaseName='TestDB', @OutputSchemaName='dbo', @OutputTableName='OldResults'","JoinKey計算列が自動的に追加される","中","スキーマ自動更新1"
"65","UT-BWH-065","sp_BlitzWho.sql","sp_BlitzWho","(main)","状態","出力テーブルにcached_parameter_infoカラムが存在しない場合","古い形式の出力テーブルが存在","@OutputDatabaseName='TestDB', @OutputSchemaName='dbo', @OutputTableName='OldResults'","cached_parameter_infoカラムが自動的に追加される","中","スキーマ自動更新2"
"66","UT-BWH-066","sp_BlitzWho.sql","sp_BlitzWho","(main)","状態","出力テーブルにlive_parameter_infoカラムが存在しない場合","古い形式の出力テーブルが存在","@OutputDatabaseName='TestDB', @OutputSchemaName='dbo', @OutputTableName='OldResults'","live_parameter_infoカラムが自動的に追加される","中","スキーマ自動更新3"
"67","UT-BWH-067","sp_BlitzWho.sql","sp_BlitzWho","(main)","状態","出力テーブルにouter_commandカラムが存在しない場合","古い形式の出力テーブルが存在","@OutputDatabaseName='TestDB', @OutputSchemaName='dbo', @OutputTableName='OldResults'","outer_commandカラムが自動的に追加される","中","スキーマ自動更新4"
"68","UT-BWH-068","sp_BlitzWho.sql","sp_BlitzWho","(main)","状態","出力テーブルにwait_resourceカラムが存在しない場合","古い形式の出力テーブルが存在","@OutputDatabaseName='TestDB', @OutputSchemaName='dbo', @OutputTableName='OldResults'","wait_resourceカラムが自動的に追加される","中","スキーマ自動更新5"
"69","UT-BWH-069","sp_BlitzWho.sql","sp_BlitzWho","(main)","状態","複数フィルタ条件の組み合わせ（OR条件）","様々なワークロードが実行中","@MinElapsedSeconds=10, @MinCPUTime=5000, @MinLogicalReads=10000","いずれかの条件を満たすクエリが返却される（AND条件ではなくOR条件）","高","複合フィルタ条件"
"70","UT-BWH-070","sp_BlitzWho.sql","sp_BlitzWho","(main)","正常系","SQL Server 2022の新機能対応","SQL Server 2022環境","デフォルト","SQL Server 2022固有の機能（利用可能な場合）が正常に動作する","中","SQL Server 2022対応"
