Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Update Statement Expand / Collapse
Author
Message
Posted Tuesday, November 27, 2007 4:48 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, October 14, 2009 1:56 AM
Points: 438, Visits: 754
Hi,

I just want to update a column in a table,values from another table.
Values should return more than 1, say 15(according to condition in the select statement).

Without using of temp tables.

Thanks in Advance.




Post #426283
Posted Tuesday, November 27, 2007 4:56 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Friday, September 19, 2014 6:08 AM
Points: 3,451, Visits: 1,072
Needed more clarity for the post


Post #426291
Posted Tuesday, November 27, 2007 5:14 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, September 18, 2014 7:56 AM
Points: 6,723, Visits: 8,462
if you can join the objects it may be pritty easy
begin transaction 
update T1
set col1=T2.colx

from mytable T1
inner join myothertable T2
on T1.mycol = T2.mycoltoo

where

is it ok ?

-- rollback tran 
-- commit tran



Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution"


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me but most of the time this is me
Post #426306
Posted Wednesday, November 28, 2007 6:10 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, October 14, 2009 1:56 AM
Points: 438, Visits: 754
Hi ALZDBA,

Thanks a lot. Its working fine.

:)

Post #426843
Posted Wednesday, November 28, 2007 8:01 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, September 18, 2014 7:56 AM
Points: 6,723, Visits: 8,462
HTH

Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution"


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me but most of the time this is me
Post #426905
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse