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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:08:50+00:00 2026-05-17T03:08:50+00:00

I have two tables from two different databases. For example: Table: Articles1 – Database:

  • 0

I have two tables from two different databases.

For example:

Table: Articles1 - Database: db1
Attributes: id date headline text

Table: Articles2 - Database: db2
Attributes: id date headline text

Now i want to make an article feed with articles from both tables combined and sorted by date. From my knowledge it isnt possible to make queries across two different databases?

What can i do ? Make a temporary table and insert alle articles and sort and print? Make a cronjob getting all articles?

Btw. im doing it with MS SQL and ASP.

Thanks in advance


After i receieved som answers i’m trying to do this:

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Provider;Data Source=myDataSource;Initial Catalog=Catalog1;User Id=myID;Password=myPassword1;"
Set Conn2 = Server.CreateObject("ADODB.Connection")
Conn2.Open "Provider=Provider;Data Source=myDataSource;Initial Catalog=Catalog2;User Id=myID;Password=myPassword2;"

strSQL = "SELECT id, datetime, headline, text "&_
            "FROM Conn.dbo.vArticles "&_
            "UNION ALL "&_
            "SELECT AutoID as id, Dato as datetime, Notat as headline, Notat as text "&_
            "FROM Conn2.dbo.Notat WHERE NotatTypeID = '5'"

DIM objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open mySQL, Conn


objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing

But getting some errors.

  • 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-17T03:08:51+00:00Added an answer on May 17, 2026 at 3:08 am

    It is possible to query across 2 different databases. Just use 3 part name format.

    SELECT id, date, headline, text 
    FROM db1.dbo.Articles1
    UNION ALL
    SELECT id, date, headline, text 
    FROM db2.dbo.Articles2
    

    The above assumes that the databases are on the same SQL Server instance. If not you will need to set up a linked server and use 4 part name format.

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

Sidebar

Related Questions

I have two different tables from which I need to pull data blogs which
I have two tables with list of urls fetched from different sources. I want
i have two tables i am trying to get information from. login table -
I have a database where I store two different kinds of data. One table
I have two tables in two different SQL Server databases on different servers. Each
I have two (same) applications running on dev.example.com and beta.example.com with different databases. Everything
I have two similar tables in different databases, I want to insert into one
I have two tables and their only difference is one column is missing from
I have this two tables from my program to manage stock: Articulos (items): id_articulo
I have two tables services and member_services To fetch records from member_services where member_type_id

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.