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

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -