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 3940214
In Process

The Archive Base Latest Questions

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

Possible Duplicates: SQL Multiple Parameter Values SQL Server (2008) Pass ArrayList or String to

  • 0

Possible Duplicates:
SQL Multiple Parameter Values
SQL Server (2008) Pass ArrayList or String to SP for IN()

I would like to SELECT some rows from a table that have certain values which are not known at the time a stored procedure is written. For example, searching for books of a particular type or types in a library database:

SELECT * FROM Books WHERE Type IN (_expr_);

Where I want _expr_ to be ('Humor', 'Thriller') one run, and maybe ('Education') the next, depending on the user’s choices. How can I vary the expression at run-time?

Unfortunately, I still have a lot to learn about SQL in general and am not sure if I’m even asking a question that makes sense. I would appreciate any guidance!

  • 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-20T00:23:30+00:00Added an answer on May 20, 2026 at 12:23 am

    This is trickier than you might think in SQL Server 2005 (2008 has table valued parameters which makes it easier)

    See http://www.sommarskog.se/arrays-in-sql-2005.html for a review of the methods.

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

Sidebar

Related Questions

Possible Duplicate: SQL Server: Can I Comma Delimit Multiple Rows Into One Column? I
Possible Duplicate: Best practice to create (on demand) SQL Server 2008 Express databases in
Possible Duplicate: app.config file in C# for MS SQL Server 2005 in VS 2008
Possible Duplicates: Is there an Oracle SQL query that aggregates multiple rows into one
Possible Duplicates: Does facebook fql contain the sql like operator? FaceBook query using FQL
Possible Duplicate: Split string in SQL I have seen a couple of questions related
Possible Duplicate: Internationalization in SSRS We use SQL Server Reporting Services for our web
Possible Duplicates: Linq to Entities - Sql “IN” clause How to implement SQL “in”
Possible Duplicate: SQL: Using Select * Hi everyone! I wonder if it is really
Possible Duplicate: Is there SQL parameter binding for arrays? I was wondering if there

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.