Click here to monitor SSC
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
SSC Rookie
SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)

Group: General Forum Members
Points: 30 Visits: 68
Comments posted to this topic are about the item Oops! SQL column swap or SQL column clobber?
Yogeshwar Phull
Yogeshwar Phull
SSC Eights!
SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)

Group: General Forum Members
Points: 918 Visits: 664
Thanks for the helpful information...
Lokesh Vij
Lokesh Vij
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1726 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
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: 1100 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
Old Hand
Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)

Group: General Forum Members
Points: 394 Visits: 302
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
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18649 Visits: 13249
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
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3117 Visits: 5064
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
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: 1100 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.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2190 Visits: 611
Good Question.

-----------------
Gobikannan
Raghavendra Mudugal
Raghavendra Mudugal
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: 1764 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