Results 1 to 4 of 4

Thread: update table from linked Excel sheet

  1. #1
    Join Date
    Mar 2008
    Posts
    2

    update table from linked Excel sheet

    I cant seem to reference columns within a linked Excel server
    using MS SQL express

    Code:

    UPDATE dbo.Items
    SET CCC=XL_SERVER.CCC
    FROM XL_SERVER...sheet1$
    WHERE BBB LIKE '7%'

    i.e I want to update column CCC in my Items table from an Excel table column CCC where column BBB begins with 7

    I have set up XL_SERVER correctly.

    Help!

  2. #2
    Join Date
    Sep 2004
    Location
    Poland
    Posts
    22
    Something is wrong with this query - what is the lookup field (join field) for dbo.items in XL_SERVER...sheet1$?
    Anyway try:
    UPDATE dbo.Items
    SET CCC=XL_SERVER...sheet1$.CCC
    FROM XL_SERVER...sheet1$
    WHERE BBB LIKE '7%'
    Last edited by vicoluf; 03-21-2008 at 03:00 AM.

  3. #3
    Join Date
    Mar 2008
    Posts
    2
    I get the following error message in MS SQL Server:

    Msg 209, Level 16, State 1, Line 4
    Ambiguous column name 'BBB'.

  4. #4
    Join Date
    Sep 2004
    Location
    Poland
    Posts
    22
    Like I wrote something is wrong with the statement. Do you have BBB field both in your linked server and dbo.item table?

    If so try:
    UPDATE a
    SET a.CCC=b.CCC
    FROM dbo.item a inner join XL_SERVER...sheet1$ b
    On a.BBB=b.BBB
    WHERE a.BBB LIKE '7%'

Posting Permissions

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