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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:32:39+00:00 2026-05-12T09:32:39+00:00

We performed an upgrade of a proprietary program that formerly used Access and now

  • 0

We performed an upgrade of a proprietary program that formerly used Access and now uses SQL. The table schema are exactly the same, but the problem is that the primary key restarted when we switched to SQL. I’ve imported the old access database into another sql table in the database. The current (SQL based) table is named Archive and the imported Access one is ArchivePreSQL. What I’m trying to do is to create a query that joins those two tables (so I have all records in one query) and adding an “S” to the primary key if it’s from the SQL table and an “A” if it’s from the imported Access table. Is it possible to do this?

I can get the first chunk of data like this, but I’m unsure how to JOIN it with the second table how I desire.

SELECT ‘S’ + CAST(id AS varchar(MAX)) AS id, Account, BillingNumber, TakenTimestamp
FROM Archive

Any help with this is much appreciated!

  • 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-12T09:32:39+00:00Added an answer on May 12, 2026 at 9:32 am

    If the sets don’t intersect, just UNION ALL them:

      SELECT 'S' + CAST(id AS varchar(MAX)) AS id, Account, BillingNumber, TakenTimestamp
      FROM Archive
      UNION ALL
      SELECT 'A' + CAST(id AS varchar(MAX)) AS id, Account, BillingNumber, TakenTimestamp
      FROM ArchivePreSQL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My company performed a data migration recently (in a SQL Server 2005 database) and
I understand that floating point arithmetic as performed in modern computer systems is not
When and how should table stats gathering be performed for Oracle, version 9 and
I have a table with a 'filename' column. I recently performed an insert into
I recently performed a migration-upgrade from TFS 2008 to TFS 2010. Almost everything is
I have an installer that I would like to use for a major upgrade.
I've performed a RESTORE DATABASE command to restore an SQL Server 2000 database on
I have a distributed windows application (written in C#) that currently uses MSDE. The
I have a Windows Service that I install and upgrade with WiX, and this
We have a Sql Server 2000 database application that needs to update our applications

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.