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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:43:11+00:00 2026-06-08T13:43:11+00:00

+——————+ | id1 | id2 | bool | +——————+ | 1 | 1 |

  • 0
+------------------+
| id1 | id2 | bool |
+------------------+
|  1  |  1  |  F   |
|  1  |  2  |  F   |
|  2  |  1  |  F   |
+------------------+

UPDATE table_name
SET bool = T
WHERE (id1, id2) IN ((1,1),(2,1)) --Need work here

So basically I want to select where the conditions of (id1, id2) = (value1, value2).
Similar to the statement below:

WHERE id1 = value1 AND id2 = value2

however in set of values in an array.
Is this possible?

Thanks in advance

EDIT: I’m using SQL server 2008. I’m sorry if it wasn’t too clear.
I’m trying to put this as a stored procedure and call it from a service. The input would be some sort of an array (variable size), and find a match with the two IDs in a row.

  • 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-06-08T13:43:12+00:00Added an answer on June 8, 2026 at 1:43 pm

    Here is the way to do it in MSSql. All you need is to make one value (in this example VARCHAR) from Id1 and Id2. In this case you can use IN statement with the values set. Also you should think about NULLs in id1 and id2 if they are allowed in these fields (just add: and id1 is not null and id2 is not null).

    UPDATE table_name
    SET bool = T
    WHERE convert(varchar(20),id1)+','+convert(varchar(20),id2) in ('1,1','2,1')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, is there a way to write a.children('.outer').children('.inner') without the intermediate selector? I can't
So to start, I have an array of XML files. These files need to
All of my code is on my SVN, but I want some of it
I have set of xml elements like this: <item code=<HTML_CODE> /> For example: <items>
I basically have the classic many to many model. A user, an award, and
&mdash; or &#8212; Is there a difference between these? Is one better-supported than the
I'm using a DatePicker ( org.apache.wicket.extensions.yui.calendar.DatePicker — Javadoc ) in a form. The form
I need to stack two tables on top of each other with content before
I need a function that will clean a strings' special characters. I do NOT
I'm trying to get random numbers between 0 and 100. But I want them

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.