|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Sunday, March 03, 2013 10:56 PM
Points: 46,
Visits: 23
|
|
itseems like the answer or question posted is wrong!!
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Yesterday @ 3:21 AM
Points: 1,843,
Visits: 971
|
|
Create Table MyTable( mainkey int not null identity (-1,1)) GO insert into MyTable default values insert into MyTable default values insert into MyTable default values
Select * from MyTable
this will give result as this
-1 0 1
I think this type of question three weeks ago.this question is similar to the question on may 31 st 2010.
Malleswarareddy I.T.Analyst MCITP(70-451)
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Yesterday @ 3:21 AM
Points: 1,843,
Visits: 971
|
|
sheik (6/27/2010) The table should be created with the identity (-1,-1). Then only we can get this result. Must be a typo error???.
It's correct.
Malleswarareddy I.T.Analyst MCITP(70-451)
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Friday, February 22, 2013 3:17 AM
Points: 242,
Visits: 87
|
|
i think there is something wrong with this answer coz it should be -1,0,1 but ans is -1,-2,-3.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Monday, March 25, 2013 1:54 AM
Points: 963,
Visits: 34
|
|
| I'm getting -1, 0, 1 as I would expect to be the right answer ( as almost all contributors)
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Thursday, March 14, 2013 4:15 AM
Points: 3,240,
Visits: 4,960
|
|
malleswarareddy_m (6/27/2010)
sheik (6/27/2010) The table should be created with the identity (-1,-1). Then only we can get this result. Must be a typo error???.
It's correct.
Right.
Create Table MyTable1( mainkey int not null identity (-1,-1)) GO insert into MyTable1 default values insert into MyTable1 default values insert into MyTable1 default values
Select * from MyTable1
drop table MyTable1
Now this code gives -1,-2,-3
Typing error. Lost my point...
---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sometimes, winning is not an issue but trying. You can check my BLOG here
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Tuesday, July 06, 2010 12:31 AM
Points: 663,
Visits: 36
|
|
I think the question is wrong. incase identity(-1,-1) then the answer ll be correct other wise will get -1,0,1 only.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, March 08, 2012 1:46 AM
Points: 148,
Visits: 31
|
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Yesterday @ 10:42 AM
Points: 1,720,
Visits: 745
|
|
Must be typing mistake from the author of this question... but how can we have "-0" in the result.
Regards, Rals.
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 12:22 AM
Points: 400,
Visits: 208
|
|
I think this is a typo.I want my point.
|
|
|
|