Exemple #1
0
        public static string GetRestartSql(Table t)
        {
            string         statementName    = t.GetColumn(t.IdentityColumn).GetName().StatementName;
            NumberSequence identitySequence = t.IdentitySequence;
            StringBuilder  builder1         = new StringBuilder(0x80);

            builder1.Append("ALTER").Append(' ').Append("TABLE");
            builder1.Append(' ').Append(t.GetName().GetSchemaQualifiedStatementName());
            builder1.Append(' ').Append("ALTER").Append(' ');
            builder1.Append("COLUMN");
            builder1.Append(' ').Append(statementName);
            builder1.Append(' ').Append("RESTART");
            builder1.Append(' ').Append("WITH").Append(' ').Append(identitySequence.Peek());
            return(builder1.ToString());
        }
Exemple #2
0
 public void Reset(NumberSequence other)
 {
     lock (this)
     {
         this._name       = other._name;
         this._startValue = other._startValue;
         this._currValue  = other._currValue;
         this._lastValue  = other._lastValue;
         this._increment  = other._increment;
         this._dataType   = other._dataType;
         this._minValue   = other._minValue;
         this._maxValue   = other._maxValue;
         this._isCycle    = other._isCycle;
         this._isAlways   = other._isAlways;
     }
 }