Quantcast
Viewing all articles
Browse latest Browse all 950

Reset Identity Column to start at 1

      I am trying to create a table with an ID field that will be purged at the end of the procedure ( or beginning of next).  the data will need to be sorted by a date field.  The issue that i'm having is that i need the ID field to always start at 1 when new data is inserted.

 

I have tried

 

1)     select "$rowid$",..... from "Test1" order by UpdateDT...

however this doesn't work with the order by clause

 

2)     

     CREATE COLUMN TABLE "Test2"

(LOT_ID INT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,

....)

 

however this doesn't start back at 1 when i rerun the insert


Viewing all articles
Browse latest Browse all 950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>