Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 6th, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to exclude Cross apply to make it conditional
  2. S.ID IN(SELECT DISTINCT ServiceEntryID
  3.                         FROM
  4.                           ServiceEntryPart M
  5.                           CROSS APPLY
  6.                           dbo.SplitStrings_Moden(M.ServiceTypeIDs, N',') M2
  7.                           JOIN dbo.SplitStrings_Moden(@ServiceTypes, N',') P ON M2.Item = P.Item
  8.                           INNER JOIN Part ON M.PartID = Part.ID
  9.                               WHERE
  10. @ActivePart is null or @ActivePart = Part.Active))