Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6848343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:51:23+00:00 2026-05-27T00:51:23+00:00

I am tasked with the following: The customer wants to read a number (possibly

  • 0

I am tasked with the following:
The customer wants to read a number (possibly thousands) of values from a csv file. I have to use these values in an SQL select statement like this:

SELECT * FROM myTable WHERE myTable.Value IN (cvsValue1, csvValue 2, ..., csvValueN)

The question is: Will this work for an arbitrary number of csv values, and will it perform well for large number of values?

I will need to save the SQL as a string internally in my C# application for later use. (if that makes a difference for alternative solutions)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:51:24+00:00Added an answer on May 27, 2026 at 12:51 am

    You really don’t want to do that. It would be better to dump those values into an indexed table and use IN as a subquery (which typically implements a SEMI JOIN (more info) vs the array of strings (which is typically implement as a series of OR operations.

    from BOL:

    Including an extremely large number of values (many thousands) in an
    IN clause can consume resources and return errors 8623 or 8632. To
    work around this problem, store the items in the IN list in a table.

    Error 8623:

    The query processor ran out of internal resources and could not
    produce a query plan. This is a rare event and only expected for
    extremely complex queries or queries that reference a very large
    number of tables or partitions. Please simplify the query. If you
    believe you have received this message in error, contact Customer
    Support Services for more information.

    Error 8632:

    Internal error: An expression services limit has been reached. Please
    look for potentially complex expressions in your query, and try to
    simplify them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been tasked with setting up a flat-file SKU database for use on
I have been tasked with updating our ancient Java applet from applet tags to
I've been tasked with porting/refactoring a Web Application Platform that we have from ASP.NET
I have recently been tasked with upgrading an application from .net 1.1 to 3.5
Basically I have been tasked with tackling the following scenario: When you are designing
I have the following XML <Skills> <SkillID>1</SkillID> <SkillName>Catch</SkillName> <SkillPrefix>Re</SkillSuffix> </SKills> I am tasked to
I'm tasked of introducing logging to a larger project. I have the following requirements:
I have been tasked with figuring out how to use python to communicate with
I have been tasked with porting data from a MongoDB database to a MySQL
I think most of us have seen the following: I'm currently tasked with converting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.