Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2012
    Posts
    3

    Updating SQL table using an excel file

    New to SQL.
    I am trying to update a SQL table using an excel file which has 2 columns FMStyle and FMHSNum.
    FMStyle is my link to the SQL table.
    Here is what I have for code....
    --------------------------------------------------
    Update DataTEST.dbo.zzxstylr
    SET hs_num = (select FMHSNum FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=c:\temp\StyleHSCodesLoad.xls;HDR=YES ', [Sheet1$]))
    Where FMStyle = zzxstylr.style
    --------------------------------------------------
    Everything seems to be ok except for the "Where FMStyle" is giving me a message Invalid Column name on FMStyle.
    Do I need to qualify FMStyle?

    Thanks
    Michael

  2. #2
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    860
    You should post this in the SQL Server forum. This is MySQL.
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com

  3. #3
    Join Date
    Nov 2012
    Posts
    3
    Yes I should, what am I doing here!!
    Thanks Ronan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •