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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:36:22+00:00 2026-05-26T07:36:22+00:00

I have an excel sheet where in the data looks similar to the table

  • 0

I have an excel sheet where in the data looks similar to the table below :

EmployeeName    Manager Name
E1              M1
E2              M2
E3              M3
E4              M1

I need to export this into a database which has two separate table for employee and manager.

Sql tables which I am exporting to has structure like this:

Create Table Manager (Manager_Id int Primary Key Identity(1,1), 
                      ManagerName nvarchar(50))

Create Table Employee (EmployeeID int Primary Key Identity(1,1) ,
                       EmployeeName nvarchar(50), 
                       Manager_Id int) 

ManagerId is a foreign reference in the employee table.

Since I need Manager Table before the Employee table, I successfully imported the manager data first using SQL Server Import and Export wizard.

My next step was to import data into the employee table.This is where the problem comes in.
Now, I want manager Id from a table sitting in the Sql Server database and the employee names from the excel sheet. I though there must be a way in the Import and Export wizard in the Sql Statement option to write a query which can refer to both excel and the sql table but I get an error “This is not a query”

Is there a better way of importing data to multiple tables?

  • 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-26T07:36:22+00:00Added an answer on May 26, 2026 at 7:36 am

    Instead of importing the Employee data to the Employee table, import it into a Temp table on SQL server. Then you will be able to write a query which retrieves the employee name from the Temp table, joins it to the Manager table and then inserts into the real Employee table.

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

Sidebar

Related Questions

I have an excel sheet with data similar to the following Reg_id Name Product_Owned
I am working on writing the data into Excel sheet in c#. I have
I have an excel sheet that looks like this data1 data2 data3 ... data10
I have an excel sheet similar to : I want to read data columns
I have an Excel sheet now I need to insert data from that sheet
I have a dynamic range in an Excel sheet. DATA_TABLE =OFFSET(DATA!$B$3,0,0,COUNTA(DATA!$B:$B)-1,0) I want to
I'm having trouble with some Excel data validation. On one sheet, I have a
I have a Excel sheet with two columns and I need to create new
I have an excel sheet that I want to load into a datatable withe
I need to write an sql query (in c#) to select excel sheet data

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.