Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ストアドプロシージャの定義でテーブル型変数の入力を指定した場合、ユーザーがこのストアドプロシージャを使用するときは、テーブルの入力が必要ですか?
テーブル入力にデフォルトのnullを割り当てることができないことがわかりました...
ありがとう。
パラメータ値が指定されていない場合、デフォルトで空のテーブルになります。
これをチェックして:
CREATE TYPE tblType AS TABLE ( id INT, name VARCHAR(30) ); alter proc testTabl( @t tblType READONLY ) As select * from @t exec testTabl
したがって、ここでデフォルトでテーブル値パラメータを指定しない場合、空のテーブルに設定されます。