Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by Praveen Goud Kotha
»
Incremental additions
32 posts, Page 1 of 4
1
2
3
4
»
»»
Incremental additions
Rate Topic
Display Mode
Topic Options
Author
Message
Praveen Goud Kotha
Praveen Goud Kotha
Posted Thursday, October 28, 2010 8:28 PM
Old Hand
Group: General Forum Members
Last Login: Thursday, September 16, 2010 7:13 AM
Points: 315,
Visits: 93
Comments posted to this topic are about the item
Incremental additions
Praveen Goud
Post #1012784
Hardy21
Hardy21
Posted Thursday, October 28, 2010 10:10 PM
SSC Eights!
Group: General Forum Members
Last Login: Monday, May 13, 2013 2:42 PM
Points: 877,
Visits: 1,158
Nice question. Thanks
Thanks
Post #1012805
srinibl
srinibl
Posted Thursday, October 28, 2010 11:14 PM
Old Hand
Group: General Forum Members
Last Login: Monday, January 30, 2012 4:12 AM
Points: 384,
Visits: 98
Good question.
Thanks
Post #1012813
Nakul Vachhrajani
Nakul Vachhrajani
Posted Thursday, October 28, 2010 11:22 PM
Ten Centuries
Group: General Forum Members
Last Login: Thursday, May 16, 2013 9:52 AM
Points: 1,277,
Visits: 1,608
Great question. Thank-you.
Thanks & Regards,
Nakul Vachhrajani.
http://beyondrelational.com/modules/2/blogs/77/nakuls-blog.aspx
Be courteous. Drive responsibly.
Follow me on
Twitter:
@nakulv_sql
Google Plus:
+Nakul
Post #1012816
Koen Verbeeck
Koen Verbeeck
Posted Friday, October 29, 2010 12:13 AM
SSCrazy Eights
Group: General Forum Members
Last Login: Yesterday @ 9:06 AM
Points: 9,367,
Visits: 6,465
Good question, but I've liked a little more explanation and if possible, a reference.
How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
Member of
LinkedIn
. My blog at
LessThanDot
.
MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1012825
Iulian -207023
Iulian -207023
Posted Friday, October 29, 2010 12:36 AM
SSC Eights!
Group: General Forum Members
Last Login: Saturday, March 16, 2013 9:53 AM
Points: 847,
Visits: 768
Great question, thanks
Here is a reference to the compound operators:
http://msdn.microsoft.com/en-us/library/cc645922.aspx
Regards,
Iulian
Post #1012833
Nakul Vachhrajani
Nakul Vachhrajani
Posted Friday, October 29, 2010 12:53 AM
Ten Centuries
Group: General Forum Members
Last Login: Thursday, May 16, 2013 9:52 AM
Points: 1,277,
Visits: 1,608
I guess the subtle point is that SQL Server will NOT throw any syntax errors because ultimately what the user is making is a logical error.
It's one of those things that one would miss when writing code in a hurry, and then spend endless nights trying to figure out what went wrong.
Thanks & Regards,
Nakul Vachhrajani.
http://beyondrelational.com/modules/2/blogs/77/nakuls-blog.aspx
Be courteous. Drive responsibly.
Follow me on
Twitter:
@nakulv_sql
Google Plus:
+Nakul
Post #1012839
Koen Verbeeck
Koen Verbeeck
Posted Friday, October 29, 2010 12:54 AM
SSCrazy Eights
Group: General Forum Members
Last Login: Yesterday @ 9:06 AM
Points: 9,367,
Visits: 6,465
Iulian -207023 (10/29/2010)
Great question, thanks
Here is a reference to the compound operators:
http://msdn.microsoft.com/en-us/library/cc645922.aspx
Regards,
Iulian
Thanks for the reference, but it still doesn't explain the question. In the question =+ is used, while the compound operator used in SQL Server is +=. I've done a little research, and it seems that a++ is the post-increment operator and ++a the pre-increment operator.
(see
http://bytes.com/topic/c/answers/506780-difference-between-pre-increment-post-increment
).
So it seems that the explanation of the question is wrong, as it states that the pre-increment operator is not used in SQL Server. SQL Server uses however a compound operator, meaning addition and assign, not incrementing the value. It still remains unknown to me why SQL Server ignores the + in =+ instead of giving a syntax error.
How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
Member of
LinkedIn
. My blog at
LessThanDot
.
MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1012840
Carlo Romagnano
Carlo Romagnano
Posted Friday, October 29, 2010 1:13 AM
SSCommitted
Group: General Forum Members
Last Login: Today @ 12:54 AM
Points: 1,969,
Visits: 1,820
So it seems that the explanation of the question is wrong, as it states that the pre-increment operator is not used in SQL Server. SQL Server uses however a compound operator, meaning addition and assign, not incrementing the value. It still remains unknown to me why SQL Server ignores the + in =+ instead of giving a syntax error.
Yes, explanation is wrong!
@a=+@b
means simply that you assign an +(expression) to @a.
+ is unary operator: http://msdn.microsoft.com/en-us/library/aa276846(SQL.80).aspx
Post #1012842
Hardy21
Hardy21
Posted Friday, October 29, 2010 1:20 AM
SSC Eights!
Group: General Forum Members
Last Login: Monday, May 13, 2013 2:42 PM
Points: 877,
Visits: 1,158
Carlo Romagnano (10/29/2010)
So it seems that the explanation of the question is wrong, as it states that the pre-increment operator is not used in SQL Server. SQL Server uses however a compound operator, meaning addition and assign, not incrementing the value. It still remains unknown to me why SQL Server ignores the + in =+ instead of giving a syntax error.
Yes, explanation is wrong!
@a=+@b
means simply that you assign an +(expression) to @a.
+ is unary operator: http://msdn.microsoft.com/en-us/library/aa276846(SQL.80).aspx
Thanks for the link. Hence, @a =+ @b means @b value assign to @a so @a = -21.
Thanks
Post #1012844
« Prev Topic
|
Next Topic »
32 posts, Page 1 of 4
1
2
3
4
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.