locked
sql command with update RRS feed

  • Question

  • Hi,

    I need to run this script (which works in properly in the management studio):

    update iondata
      set
        [Vll avg] = t.[Vll avg],
        [Vll ab] = t.[Vll ab],
        [Vll bc] = t.[Vll bc]    
    from iondata d
    inner join iontemp t
    on d.DataLogStampID=t.DataLogStampID and
       d.timestamputc = t.timestamputc

    Both table are filled with data and I'm trying to do this with an sql command authough the resulting table is empty (it doesn't return any error).

    This script is inside an sql command and is alone, what I don't know is  wheter I need to create an ole db origin or any thing else?

    Can anybody help me?

    Thanks in advance.

    Thursday, July 5, 2012 1:21 PM

Answers

  • Thanks Chuck for your help.

    I've solved the problem using a Excecute SQL Task.

    Regards.

    • Marked as answer by Eileen Zhao Tuesday, July 10, 2012 9:35 AM
    Thursday, July 5, 2012 3:09 PM

All replies

  • If you run that same code in an SSMS query window - does it work?   And what do you mean by "resulting table is empty"?  It is an update statement, it does not insert any records it updates existing records.

    Chuck Pedretti | Magenic – North Region | magenic.com

    Thursday, July 5, 2012 1:28 PM
  • Hello Droig

    Please Try with This Query..

    update D
      set
        D.[Vll avg] = t.[Vll avg],
        D.[Vll ab] = t.[Vll ab],
        D.[Vll bc] = t.[Vll bc] 
    from iondata D inner join iontemp T
    on  D.DataLogStampID=t.DataLogStampID
    and D.timestamputc  =t.timestamputc
    
    

    Best Regards.


    Please vote if you find this posting was helpful or Mark it as answered. Leonardo Martínez

    Thursday, July 5, 2012 1:34 PM
  • Yes it works.

    All the fields (of float type) are empty once the task has ended up but, it should contain values different than null.

    It only updates values in a table with existing records.

    Thursday, July 5, 2012 1:57 PM
  • It doesn't work.

    Sorry but I'm begining with ssis, I worked with sql server 2k dts until now.

    My question is, is it necessary to put ole db origins connecting to the sql command? At this moment it's alone in the design.

    Thursday, July 5, 2012 2:01 PM
  • Thanks for your reply. It has worked with a Execute SQL Task.

    Regards.

    Thursday, July 5, 2012 3:08 PM
  • Thanks Chuck for your help.

    I've solved the problem using a Excecute SQL Task.

    Regards.

    • Marked as answer by Eileen Zhao Tuesday, July 10, 2012 9:35 AM
    Thursday, July 5, 2012 3:09 PM