SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Oops! SQL column swap or SQL column clobber?


Oops! SQL column swap or SQL column clobber?

Author
Message
Thomas.Kovarik
Thomas.Kovarik
Valued Member
Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)

Group: General Forum Members
Points: 52 Visits: 68
Comments posted to this topic are about the item Oops! SQL column swap or SQL column clobber?
Yogeshwar Phull
Yogeshwar Phull
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1074 Visits: 685
Thanks for the helpful information...
Lokesh Vij
Lokesh Vij
SSCertifiable
SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)

Group: General Forum Members
Points: 5422 Visits: 1599
Good one Thomas! I was aware that column values will be swapped :-)

~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter


Dineshbabu
Dineshbabu
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1798 Visits: 569
Actually I'm unable to understand the comments and answers properly. Problem is with the word "CLOBBER".

But I'm aware of UPDATE behaviour and I know there won't be any issues in the query.

--
Dineshbabu
Desire to learn new things..
manik_anu
manik_anu
SSC Eights!
SSC Eights! (996 reputation)SSC Eights! (996 reputation)SSC Eights! (996 reputation)SSC Eights! (996 reputation)SSC Eights! (996 reputation)SSC Eights! (996 reputation)SSC Eights! (996 reputation)SSC Eights! (996 reputation)

Group: General Forum Members
Points: 996 Visits: 319
hi dinesh,
In that update query, while execute set c1 = c2 the c1 column values will be changed, then in that next statement c2 = c1 how it ill work? so c1 column is called as "clobber". i thing so.... if it is wrong please any one clear out my doubt.......



**************
Manik
Go fast as possible

Manik
You cannot get to the top by sitting on your bottom.
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (130K reputation)SSC Guru (130K reputation)SSC Guru (130K reputation)SSC Guru (130K reputation)SSC Guru (130K reputation)SSC Guru (130K reputation)SSC Guru (130K reputation)SSC Guru (130K reputation)

Group: General Forum Members
Points: 130797 Visits: 13345
Easy one (thanks Itzik! :-)) to end the week. Thanks!


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Kingston Dhasian
Kingston Dhasian
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10418 Visits: 5324
Great Question. But the link provided has no information specific to this behavior.


Kingston Dhasian

How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Dineshbabu
Dineshbabu
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1798 Visits: 569
Kingston Dhasian (2/1/2013)
Great Question. But the link provided has no information specific to this behavior.


+1

--
Dineshbabu
Desire to learn new things..
Gobikannan
Gobikannan
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2398 Visits: 614
Good Question.

-----------------
Gobikannan
Raghavendra Mudugal
Raghavendra Mudugal
SSCertifiable
SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)

Group: General Forum Members
Points: 5196 Visits: 2958
Dineshbabu (1/31/2013)
Actually I'm unable to understand the comments and answers properly. Problem is with the word "CLOBBER".....


Same here but after checking this http://en.wikipedia.org/wiki/Clobbering, it kind of eased the question to understand.

Like it says c1 = c2 and c2 = c1, if we do the same in programming language like this


Dim a As Integer
Dim b As Integer
a = 1
b = 2
a = b
b = a


in the 5th line a = 2 and 6th line b is not 1 as a is already 2 so here the original value of a which was 1 is no longer in picture, so the b is written to b itself with its original value.

(i guess, i got this write... ;-) )

ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search