Code: Select all
ALTER TABLE "table" ALTER COLUMN column RESTART WITH value
Code: Select all
ALTER TABLE "contacts" ALTER COLUMN id RESTART WITH 0
Code: Select all
ALTER TABLE "table" ALTER COLUMN column RESTART WITH value
Code: Select all
ALTER TABLE "contacts" ALTER COLUMN id RESTART WITH 0
Now I want to put the Database into Production, yet I cant seem to reset the Auto Value back to 0, it carries on from 20.ALTER TABLE "Customers" ALTER COLUMN ID RESTART WITH 0
This may be a stupid question and I may be taking this out of context (it is Monday after all), but why would the ID be bad design to have real world relevance? I mean if you create a table for Orders and used a field called OrderID as your Primary key and chose to make it auto number, that would have a real world relevance, right? What is the draw back to that?DrewJensen wrote: Second - why worry about it. The ID should have no real world relevance and to impart any is considered very bad design...
If you use this ID in real world communication as invoice number instead of, let's say "ASDF-20080121-BX5", then you will lose the information after reset. The invoices you already sent have the old id-numbers.Bret Fledderjohn wrote:Slightly off the main topic...
This may be a stupid question and I may be taking this out of context (it is Monday after all), but why would the ID be bad design to have real world relevance? I mean if you create a table for Orders and used a field called OrderID as your Primary key and chose to make it auto number, that would have a real world relevance, right? What is the draw back to that?
-Bret
Code: Select all
ALTER TABLE "contacts" ALTER COLUMN "id" RESTART WITH 0
See also: Naming conventions: double-quotes or ALL_CAPS with Basedylan_k wrote:I got an error...until I put the table AND column names in quotes.