fsprojects / fsprojects/FSharp.Data.SqlClient
Document usage of STRING_SPLIT with IN instead of Table-Valued Parameters
Nobody has claimed this yet.
- Dominant language
- F#
- Stars
- 206
- Forks
- 66
- PR merge metrics
- No merged PRs in 30d
Description
It seems the consensus on using IN is to explicitly use table-valued parameters, requiring defining types and putting your query in a stored procedure. There's a much easier way that abstracts away the TVP stuff that I suggest should be added to the documentation: Use STRING_SPLIT. Example:
DECLARE @param varchar(1000) = @commaSeparatedList
SELECT Col1 FROM MyTable
WHERE Col2 IN (
SELECT value FROM STRING_SPLIT(@param, ',')
)
(It has to be declared to avoid the same error as described in #309.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue points to documentation about using IN and table-valued parameters, plus related issue #309; start by finding that section. Add the STRING_SPLIT example and declaration guidance shown here, using the linked SQL Server reference. Done when the documentation clearly explains this alternative.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100