Reset Identity Column in SQL Server table with VB 
Author Message
 Reset Identity Column in SQL Server table with VB

Does anybody know how to reset an identity column in a SQL Server table
using VB code?  Through ADO, Stored Procedure or some other method?

I have an identity column that will eventually exceed it's data type
capabilities because large numbers of records are being added through a
reoccurring bulk load.  I would like to be able to set the identity column
starting value back to 1 each time the process is started.  All tables are
being cleared, so there are no references to the column values to worry
about.

Thanks.



Mon, 18 Nov 2002 03:00:00 GMT  
 Reset Identity Column in SQL Server table with VB
use query "truncate table xxx" instead of "delete from xxx"

[ufo], 393431


Quote:
> Does anybody know how to reset an identity column in a SQL Server table
> using VB code?  Through ADO, Stored Procedure or some other method?

> I have an identity column that will eventually exceed it's data type
> capabilities because large numbers of records are being added through a
> reoccurring bulk load.  I would like to be able to set the identity column
> starting value back to 1 each time the process is started.  All tables are
> being cleared, so there are no references to the column values to worry
> about.

> Thanks.



Wed, 20 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Run time error 3622: OpenRecordSet: SQL server table: IDENTITY column

2. RDO: Connecting to SQL server table containing an identity column

3. SQL Server/VB (Identity Column)

4. VB 4.0 & SQL Server 6.5 (Identity Column)

5. OpenRecordset and SQL Table w/ IDENTITY Column

6. SQL SERVER + IDENTITY column + DbSeeChanges PROBLEM

7. RDO, SQL Server and IDENTITY columns

8. Getting Identity column in SQL Server

9. SQL Server AddNew Identity Column

10. ADO 2.0, SQL Server 7.0, ServerSide cursors, IDENTITY columns after rs.AddNew

11. Programatically drop IDENTITY column in SQL Server?

12. SQL PK Identity column problem with VB Update command

 

 
Powered by phpBB® Forum Software