SQL SPLIT

From Logic Wiki
Revision as of 10:29, 22 November 2017 by AliIybar (Talk | contribs) (Created page with "Category:SQL When you need to pass a string variable to a stored procedure, you can split it in a query like below <pre> (@Areas is null or r.AreaCode IN (SELECT value...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


When you need to pass a string variable to a stored procedure, you can split it in a query like below

(@Areas is null or r.AreaCode IN (SELECT value FROM STRING_SPLIT(@Areas, ',')) )

	SELECT * FROM [dbo].[tblAction]
		WHERE Assignee IN (SELECT value FROM STRING_SPLIT(@Assignee, ',')) 
		ORDER BY CreateDate Desc