Re: resetting seed



vvf,
It depends on what the error was.

For example, if it was a constraint error, then you need to eliminate the
constraints. Read about constraints in the BOL.

Here is a BOL code snippet on resetting the seed:
CREATE TABLE MyCustomers (CustID INTEGER IDENTITY (100,1) PRIMARY KEY,
CompanyName NvarChar (50))
INSERT INTO MyCustomers (CompanyName) VALUES ('A. Datum Corporation')
ALTER TABLE MyCustomers ALTER COLUMN CustId IDENTITY (200, 2)I do not have
SQL Server CE running, so this is all untested logic.RLF"vvf"
<novvfspam@xxxxxxxxxxx> wrote in message
news:%23%23e5ldfcHHA.3632@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

I have to reset the identity seed on one of my SQL Server CE (2.0) tables.
As far as I read, only TRUNCATE TABLE is my option. However, when I try to
use truncate in Query Analyzer, I get an error. So, how do I correctly
reset
the seed? Ideally, I would be able to reset it to a certain number
(instead
of just 1) but if that cannot be done, I can work around it.

Thanks.






.



Relevant Pages

  • Re: resetting seed
    ... Read about constraints in the BOL. ... CREATE TABLE MyCustomers PRIMARY KEY, ... I have to reset the identity seed on one of my SQL Server CE ...
    (microsoft.public.sqlserver.ce)
  • Re: I want to re-use a project plan - how dao I change the initial dat
    ... When all tasks have been reset to 0% done, and there are no tasks with ... When you DO have constraints in the project you will need to run ... toolbar ... do I cahnge the dates so I can re-use this plan for different outages. ...
    (microsoft.public.project)
  • Re: DataTable.Reset() vs DataTable.RejectChange()
    ... Reset is used to reset the table to the same state after it is created (it ... clears columns, constraints, ..). ... While the RejectChanges resets only the data changes from the last neutral ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: DataTable.Reset() vs DataTable.RejectChange()
    ... >Reset is used to reset the table to the same state after ... >clears columns, constraints, ..). ... >miha at rthand com ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: DTS in SQL 2005 on tables with constraints
    ... constraints in between running the scripts and actually generating the ... script to have the ALTER TABLEs to reinstate the constraints is a pain ... I thought that EXEC sp_msforeachtable "ALTER TABLE ... NOCHECK CONSTRAINT all" might do the trick, but you can't TRUNCATE ...
    (microsoft.public.sqlserver.dts)

Quantcast