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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:47:37+00:00 2026-05-22T01:47:37+00:00

For every week I have excel sheet converted to SQL database this excel sheet

  • 0

For every week I have excel sheet converted to SQL database this excel sheet gave me 30 deference table with same structure and field definition but there is no relationship between these tables.

So I want to merge the data from these 30 table in one table I’m trying to write T-sql to do this but I fail by using INFORMATION_SCHEMA.Tables or sys.tables to get the table names and proceed to fetch data from these tables in one query.

  • 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-22T01:47:37+00:00Added an answer on May 22, 2026 at 1:47 am

    To combine tables together with the exact same schema:

    SELECT * FROM Table1
    UNION
    SELECT * FROM Table2
    

    If your entire DB is made up of these tables you should be able to use the sp_msforeachtable procedure.

    CREATE TABLE #TempTable (Col1 INT, Col2 NVARCHAR(50))
    sp_msforeachtable 'INSERT INTO #TempTable (Col1 , Col2) SELECT Col1 , Col2 FROM ?'
    SELECT * FROM #TempTable
    DROP TABLE #TempTable
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Oracle database that runs a PL/SQl job once every week to
I have a repeatable business process that I execute every week as part of
Here's my query. What I want to do is run this query every week
I have a mysql table with users and their weekly calendar. Every user can
I want to create an invoice of every 2 week. An invoice can have
I have a strings.xml file with 52 strings (week1 - week52). Every week contains
I want so send every week an update by email. But Im afraid that
Our business sends a newsletter to a vast number of subscribers every week. When
I'm running a website with more than 60 000 registered users. Every week notifications
Every time I turn on my company-owned development machine, I have to kill 10+

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.