sql server - SQL Table Valued Parameter - Default Value -
i'm passing table valued parameter stored procedure use in clause, want check whether parameter has been passed-in or not first. best way check parameter of type? example, want select along lines of:
select * tablename @tvp null or recordid in (select * @tvp)
if parameter of table valued type not passed, empty table. can use:
select * tablename not exists(select * @tvp) or recordid in (select * @tvp)
Comments
Post a Comment