|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, December 28, 2011 6:08 AM
Points: 2,
Visits: 19
|
|
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
== > ok in that case mainkey will increase by -1 ,
it will show -1, -1+(-1)=-2 -2 + (-1) =-3
and so on
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, February 21, 2013 8:55 AM
Points: 219,
Visits: 807
|
|
UMG Developer (6/28/2010) Also, if the identity increment was -1, then both option 1 and 3 would be correct, as there is no clustered index to order it, and no ORDER BY statement specified, so either -1, -2, -3 or -3, -2, -1 could be the result.
+1
Without explicit ORDER BY, there is no way we can predict the order. We could get any permutation, such as 1-,-3,-2 or -2,-1,-3 and so on.
Can you fix the incorrect multiple choice?
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Today @ 4:46 PM
Points: 31,433,
Visits: 13,745
|
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, February 21, 2013 8:55 AM
Points: 219,
Visits: 807
|
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, November 28, 2011 10:21 PM
Points: 272,
Visits: 30
|
|
| Nice question. now I got clear idea on Identity(seed, increment). Thanks
|
|
|
|