FN_Split() Table Valued Function by SQL Instructor Jeff Jones

Home > Blogs > SQL Server > FN_Split() Table Valued Function by SQL Instructor Jeff Jones

FN_Split() Table Valued Function by SQL Instructor Jeff Jones

Like This Blog 0 Jeff Jones
Added by December 8, 2007

Fn_Split()

The link above is to a file with a table-valued function called fn_split(). This function allows you to pass a string of values to an IN clause of a SQL query. It breaks them down into a set of rows in a virtual table. Then you use a subquery in the IN clause.

This function is very useful when passing multi-valued parameters in a SQL Server Reporting Services report into a stored procedure.  The parameter is defined in the stored procedure as a large varchar string (max 8000 character).  In the stored procedure you would reference the function in the WHERE clause where you  want to use the multiple parameter values.

Example:

SELECT *
FROM table
WHERE column IN (SELECT [value] FROM dbo.fn_split(@parameter, ','))

Videos You May Like

How to create a Cisco IOS Banner – Login and MOTD Message of the Day

0 4111 4

In this video, Cisco CCNA instructor Mark Jacob shows how to create a Login and Message of the Day (MOTD) banners in Cisco IOS. The Banner is an interesting feature of the Cisco IOS. You could probably get by without it, but in a commercial environment you want to have it.

Agile Methodology in Project Management

0 187 0

In this video, you will gain an understanding of Agile and Scrum Master Certification terminologies and concepts to help you make better decisions in your Project Management capabilities. Whether you’re a developer looking to obtain an Agile or Scrum Master Certification, or you’re a Project Manager/Product Owner who is attempting to get your product or … Continue reading Agile Methodology in Project Management

How to Use Oracle Virtual Box

0 14 0

Video tutorial on how to How to Use Oracle Virtual Box by Cisco and NET+ instructor Mark Jacob. By far easier than re configuring an actual machine, you can make the virtual machine the way you want it, save that snapshot, and get back to it if you want. You can save the snapshot, clone … Continue reading How to Use Oracle Virtual Box

Write a Comment

Share your thoughts...

Please fill out the comment form below to post a reply.