FN_Split() Table Valued Function by SQL Instructor Jeff Jones
FN_Split() Table Valued Function by SQL Instructor Jeff Jones
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, ','))
You May Also Like
FN_Split(), IN Clause, SQL, SQL Query, SQL Server, Table Valued Function
Agile Methodology in Project Management
0 166 0In 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
JavaScript for C# Developers – September 24, 2014
0 495 3Is JavaScript worth taking the time to learn if I’m a server-side .NET developer? How much of C# carries over to JavaScript? In this recorded video from Dan Wahlin’s webinar on September 24,2014, Dan answers these questions and more while also discussing similarities between the languages, key differences, and the future of JavaScript (ES6). If … Continue reading JavaScript for C# Developers – September 24, 2014
How to clone a Windows Server 2012 or 2012 R2 Domain Controller
3 1632 3One of the coolest new features in Window Server 2012 and Windows Server 2012 R2 is the ability to clone a Domain Controller. In the past, if we had virtualized Domain Controllers and we actually took a snapshot of it and then rolled back to that snapshot, it would break the logon service on that … Continue reading How to clone a Windows Server 2012 or 2012 R2 Domain Controller