Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 What will be the output of the following? Rate Topic Display Mode Topic Options
Author
 Message
 Posted Saturday, June 26, 2010 11:14 AM
 SSC-Enthusiastic Group: General Forum Members Last Login: Friday, September 3, 2010 4:19 AM Points: 158, Visits: 72
 Comments posted to this topic are about the item What will be the output of the following?
Post #943474
 Posted Saturday, June 26, 2010 11:16 AM
 SSC-Enthusiastic Group: General Forum Members Last Login: Monday, August 9, 2010 9:02 AM Points: 153, Visits: 90
 how come.. i am getting -1,0,1 only..someone explain please Kindest Regards,PaarthasarathyMicrosoft Certified Technology Specialisthttp://paarthasarathyk.blogspot.com
Post #943476
 Posted Sunday, June 27, 2010 4:21 AM
 SSCertifiable Group: General Forum Members Last Login: Wednesday, November 16, 2016 3:09 AM Points: 5,147, Visits: 257
 first - all available answers are wrong. "-1,-0,1" is the better looking although you will not get "-0"second - with identity (-1,1) you can only get -1, 0, 1. If you want to get -1,-2,-3 you would need identity(-1,-1)There is something wrong with either question or with the answers.
Post #943536
 Posted Sunday, June 27, 2010 8:16 AM
 SSC Journeyman Group: General Forum Members Last Login: Thursday, November 5, 2015 2:05 AM Points: 94, Visits: 101
 The table should be created with the identity (-1,-1). Then only we can get this result. Must be a typo error???.
Post #943546
 Posted Sunday, June 27, 2010 9:51 PM
 Ten Centuries Group: General Forum Members Last Login: Monday, August 22, 2016 5:45 PM Points: 1,395, Visits: 38
 Since the question is wrong then everyone who selected "-1,0,1" should get a point!
Post #943628
 Posted Sunday, June 27, 2010 10:10 PM
 Old Hand Group: General Forum Members Last Login: Tuesday, March 22, 2011 4:53 AM Points: 396, Visits: 23
 Yes, To get -1,-2,-3 identity should be -1 insteed of 1.Regards,Pankaj BhandariMicrosoft Certified Technology Specialist
Post #943632
 Posted Sunday, June 27, 2010 10:33 PM
 SSCrazy Group: General Forum Members Last Login: Tuesday, April 19, 2016 5:42 AM Points: 2,831, Visits: 374
 Yeah!... i have executed the query in SSMS 2005... and I get the result as "-1,0,1"we should get our points back... john-byrne (6/27/2010)Since the question is wrong then everyone who selected "-1,0,1" should get a point!
Post #943637
 Posted Sunday, June 27, 2010 10:39 PM
 SSCommitted Group: General Forum Members Last Login: Wednesday, December 7, 2016 3:16 AM Points: 1,710, Visits: 2,117
 With an identity of (-1,1), -1, -2 and -3 is just not the possible output.The first record that goes in will have -1. Next would be -1 + 1 = 0. Finally, we would have 0 + 1 = 1.It's probably just a typo, and I am sure the moderators will take a look and award the points.The points not being awarded is a typical drawback with the automated evaluation systems - after all, all automation works on GIGO. If there was an error in framing the question, there's bound to be an error in the evaluation. Just another example of why automation should not be allowed work without supervision :) Thanks & Regards,Nakul Vachhrajani.http://nakulvachhrajani.comBe courteous. Drive responsibly.Follow me on Twitter: @sqltwinsGoogle Plus: +Nakul
Post #943638
 Posted Sunday, June 27, 2010 11:14 PM
 SSC Journeyman Group: General Forum Members Last Login: Tuesday, June 29, 2010 12:09 AM Points: 76, Visits: 9
 The answer is -1,0,1. The provided answer is wrong. To get -1,-2,-3, we have to set the identity increment as -1.Juts give the points... 10 times of the actual point.....
Post #943643
 Posted Sunday, June 27, 2010 11:30 PM
 SSC-Addicted Group: General Forum Members Last Login: Thursday, April 23, 2015 4:30 AM Points: 494, Visits: 561
 Even i am getting the answer as "-1, 0, 1".I have executed the query in SQL 2008 Enterprise edition.i am agreeing with others about the fact thatto get ans as -1, -2, -3, the seed value should be -1.@Moderator :Look in this.
Post #943645

 Permissions