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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:49:13+00:00 2026-05-25T23:49:13+00:00

I have two sql tables called scan_sc and rescan_rsc . The scan table looks

  • 0

I have two sql tables called scan_sc and rescan_rsc. The scan table looks like this:

CREATE TABLE scan_sc 
( 
   id_sc int(4), 
   Type_sc varchar(255), 
   ReScan_sc varchar(255), 
   PRIMARY KEY  (id_sc)
)

When a scan a document I insert a row into the scan table. If the result of this scanning is poor I have to do a rescan, and therefore I have a rescan table.

CREATE TABLE rescan_rsc 
(
   id_rsc int(4), 
   Scan_rsc varchar(255), 
   PRIMARY KEY  (id_rsc)
)

The problem is, I want to have a trigger that will fill in the column ReScannet_sc with an "x", in the scan_sc table, so I can see that there has been some problems here.

The trigger has to do it where the id from the rescan table is the same as in the scan table.

Hope you all understand my question.

Thanks in advance.

  • 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-25T23:49:14+00:00Added an answer on May 25, 2026 at 11:49 pm

    Do you really need the ReScan_sc column and the trigger?

    With a simple JOIN, you can find out the records in your scan_sc table that have been re-scanned, without using the ReScan_sc column at all.
    There are several possibilities:

    Show all scans, with an additional column with the Rescan ID, if any:

    SELECT scan_sc.*, rescan_sc.id_rsc
    FROM scan_sc
    LEFT JOIN rescan_sc ON scan_sc.id_sc = rescan_sc.id_rsc
    

    Show only the scans which have been re-scanned:

    SELECT scan_sc.*
    FROM scan_sc
    INNER JOIN rescan_sc ON scan_sc.id_sc = rescan_sc.id_rsc
    

    (I assume that id_sc and id_rsc are the primary keys and that PRIMARY KEY (id_sd) is a typo, like marc_s pointed out in his comment)

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

Sidebar

Related Questions

So here's the setup. I have two tables: CREATE TABLE dbo.TmpFeesToRules1(Name varchar, LookupId int)
I'm wondering if this is possible in SQL. Say you have two tables A
To keep this simple, lets say I have two tables. The first is called
I have two tables, one called Events and one called Documents. Each table has
I have two tables like the following hotels ------ hotelID hotelName Second table operators
I have two tables called messages and users . In the messages table, there's
I have two SQL Server tables with Primary Keys (PK) and a Foreign Key
We have two tables in a SQL Server 2005 database, A and B.There is
I have two tables Team_DATA and Driver_PROFILE_DATA in an SQL database. For every driver_profile
In SQL Server 2008: I have two tables, dtlScheme and dtlRenewal, with a one

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.