Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Location
    India
    Posts
    523

    Question Unanswered: update statement

    hi,
    I want to do some thing like:

    Update @table1 set col1=(select col1 from table2 where
    table2.col2=@table1.col2)
    where @table1.col2=table2.col2
    here @table1 is a table variable.
    I can not get thro this update.Please help.
    regards,
    harsh

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401

    Re: update statement

    Originally posted by harshal_in
    hi,
    I want to do some thing like:

    Update @table1 set col1=(select col1 from table2 where
    table2.col2=@table1.col2)
    where @table1.col2=table2.col2
    here @table1 is a table variable.
    I can not get thro this update.Please help.
    regards,
    harsh
    Harsh ...

    is this what you are trying to do

    Code:
    Update a set a.col1= b.col1
    from @table1 a, table2 b
    where a.col2=b.col2
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

Posting Permissions

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