|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Friday, December 07, 2012 8:25 AM
Points: 540,
Visits: 245
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 6:42 AM
Points: 1,370,
Visits: 2,285
|
|
| Gud question. I had forgotten abt incremental value as I never use it. I always increment identity column with default value.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Wednesday, March 27, 2013 9:02 AM
Points: 1,046,
Visits: 573
|
|
Nice one, realised my mistake after running the qry on management studio.
What you don't know won't hurt you but what you know will make you plan to know better
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Yesterday @ 2:04 AM
Points: 1,968,
Visits: 1,819
|
|
San-847017 (10/28/2009) I always increment identity column with default value. I used a seed = 1 and an increment of 5 and in another table seed = 2 and an increment of 5. So table A always has last digit = 1 or 6 and table B 2 and 7. When I reference in table C the two table above, I know thanks to the last digit which table is linked.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Tuesday, January 15, 2013 4:22 AM
Points: 343,
Visits: 56
|
|
| In your explanation 'According to BOL, "If the table contains an identity column, the counter for that column is reset to the seed value defined for the column. If no seed was defined, the default value 1 is used."' you omit to say that this is for TRUNCATE.
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Yesterday @ 1:53 PM
Points: 785,
Visits: 1,534
|
|
| bah. automatically assumed it was seeded with increments of 1. i've never used a non-1 increment personally :/
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, March 22, 2013 6:48 AM
Points: 1,291,
Visits: 138
|
|
Shoot! I had the identity increment right, but forgot about truncate table resetting the seed value.
Mark
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Thursday, January 17, 2013 2:34 PM
Points: 565,
Visits: 360
|
|
kramaswamy (10/29/2009) bah. automatically assumed it was seeded with increments of 1. i've never used a non-1 increment personally :/ Ditto .
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Thursday, January 17, 2013 2:34 PM
Points: 565,
Visits: 360
|
|
Mark Harr (10/29/2009) Shoot! I had the identity increment right, but forgot about truncate table resetting the seed value. There was a recent question which brought that point out (maybe Mark missed it ). I appreciate this question's showing an aspect of IDENTITY() with which I wasn't familiar.
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Friday, March 15, 2013 2:43 PM
Points: 3,924,
Visits: 1,554
|
|
Damn. I missed the increment/seed part. Generally we used (1,1) for identity column and its (1,3) in the question.
SQL DBA.
|
|
|
|