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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:26:39+00:00 2026-06-15T06:26:39+00:00

I need to update a SQL table with our current job info from an

  • 0

I need to update a SQL table with our current job info from an Excel sheet each time data captured from the Mfg equipment, I can do this by creating a stored procedure that I can execute using a JScript that is run by the program capturing the data and writing it to the Db.

I’m now able to query the Excel sheet fine and view the data that I need, but the formatting is a bit of a gotcha, without running queries to separate the data row by row then one update I can’t think of how to update it.

Query against sheet:

 SELECT Item, L05, L08, L09, SS1, SS2, SS3
 FROM (
    SELECT ROW_NUMBER() OVER (ORDER BY F8) AS rownumber, F1 AS Item, F2 AS L05, F3 AS L08, 4 AS L09, F5 AS SS1, F6 AS SS2, F7 AS SS3
    FROM OpenDataSource( 'Microsoft.ACE.OLEDB.12.0',
    'Data Source="C:\Job.xlsx";Extended Properties="Excel 12.0 XML;HDR=NO";')..."'Job Details$'") AS T2
  Where rownumber >= 5 AND rownumber<=8

Returns:

Item L05       L08        L09       SS1       SS2       SS3
WO   806314    806334     806618    806314    805886    807031
TE   TE2-05712 TE2-04481  TE2-06364 TE2-06345 TE2-06362 TE2-04420
TF   TF2-10874 TF2-07754A TF2-14249 tf2-10874 TF2-12635 TF2-12468
Qty  39144     82800      127200    36348     121800    50660

Each equipment line is a column, and each data item is a row in the sheet, I need to reference the values and update to the table that looks like this:

LINE      WO      TE      TF      Qty
Line05    NULL    NULL    NULL    NULL
Line08    NULL    NULL    NULL    NULL
Line09    NULL    NULL    NULL    NULL
SS1       NULL    NULL    NULL    NULL
SS2       NULL    NULL    NULL    NULL
SS3       NULL    NULL    NULL    NULL

Ideally since the sheet is fixed I could reference the Excel cells individually in the update statement, but I haven’t seen a way to do that if it is possible.

  • 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-06-15T06:26:40+00:00Added an answer on June 15, 2026 at 6:26 am

    @bluefeet This worked to pull the correct order of things, but all of the values were NULL, I wound up thinking outside the question a little and rather than re-arranging everything in T-SQL I created and hid a new Excel sheet in the workbook with cells linked to the original sheet in the order I need them, and then queried that instead.

    Thanks for the help everyone.

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

Sidebar

Related Questions

I need to update time info in a DateTime. I get a string in
So I have this SQL table that I need to update. Now we use
We're designing data import from an external source like MAS200 into our production SQL
I am trying to update database fields from one SQL Server table to another.
I need to update tens of thousands rows in SQL table row-after-row. How is
This SQL statement example is very close to what I think I need... update
I need to update my .htaccess file to redirect permanently all URLs from http://example.com/pages/5604/article/something/?page=299
I need to update a json list of object via url post data. For
I need to update the Notes field in my table tblMain by concatenating the
Question: In our SQL-Server 2005 database, we have a table T_Groups. T_Groups has, amongst

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.