How to set autoinc

Kisu
Member Posts: 381
How do I set the start value for autoinc field so it wont start from the last value I had before clearing the table?
Table, Test, 123456700
Variable line, datatype bigint, autoincrement
Table, Test, 123456700
Variable line, datatype bigint, autoincrement
K.S.
0
Answers
-
Navision resets this when you change back and forth from autoincrement and not.
You can also do this with a SQL script. I do not have this available from the top of my head but I am sure that if you use google on Reset Identity Insert (SQL terminology) you will get the proper results.0 -
Mark Brummel wrote:Navision resets this when you change back and forth from autoincrement and not.
You can also do this with a SQL script. I do not have this available from the top of my head but I am sure that if you use google on Reset Identity Insert (SQL terminology) you will get the proper results.
Okay, thanksK.S.0 -
[Topic moved from 'NAV/Navision' forum to 'SQL General' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
If you want to reset the AutoIncrement values via TSQL this would be the TRUNCATE TABLE command (this deletes all data from the table and resets the identity value).
If you want to set a specific value for an AutoIncrement field, and/or a specific increment value you could use the IDENTITY feature from SQL Server (check out the "Books Online" for details).
Best regards,
JörgJörg A. Stryk (MVP - Dynamics NAV)
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions