How to reset table ID ?
Application Type
Reactive

Hello,

Please how can i reset my table ID after have deleted all the records ?

I tried to delete the table but some errors appears due to the database relationship and the behavior still very weird so i don't think is a good solution.

Thanks

Julien

Your problem is on the ID, where don't let you delete the table? if so, you must change the delete rule of the property's property ID to ignore(if you want to keep the data) or delete(if you want to remove).

Can you give more details?

Regards,

Márcio C.

I can delete the table BUT i can't reset the ID increment to zero.

Try this, I dunno if it will work but I already saw it in some cases. Try to change the name of the ID and publish, and then put again as ID and publish again and tell me if the ID is at zero now.


The table you are using as references to other tables?

Hi,

If your user have permissions, you can use a TRUNCATE statement.

TRUNCATE TABLE {EntityName};

Hi,

I tried with SQL test but it not works. Error :

Thanks

Hi Julien,

you'll probably have to do this directly on SQL Server.

Please check the delete rule property of entity, then fire Truncate command in SQL.

Hello Julian 

To delete the data from Entity... first look into the Entity Delete Rule and it should be Ignore (If you want to delete the data anyhow and "Ignore" will keep the relative data in other tables.)


Then try to delete the rows or use  TRUNCATE TABLE {EntityName}; direct in SQL


This might work for you :)

Hi @Julien Garcia,

To reset a table primary key auto number you need to truncate the table.

SQL Server - https://docs.microsoft.com/en-us/sql/t-sql/statements/truncate-table-transact-sql?view=sql-server-ver15

Oracle - https://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_10007.htm#SQLRF01707

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.