0

I have in my function this TVP parameter:

@SiteTypeId [dbo].[intArray]

How can I check if this parameter is empty?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Michael
  • 13,950
  • 57
  • 145
  • 288

1 Answers1

1

How can I check if this parameter is empty? Here considering empty as zero records in table since it is a table valued parameter

You can check it using IF NOT EXISTS

IF NOT EXISTS (Select 1 from @SiteTypeId)
Begin
--statements
End
Pரதீப்
  • 91,748
  • 19
  • 131
  • 172