Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DBCC CHECKIDENT -- Schema aware?

Tags:

I've got a different schema (besides dbo) that I've created a table in, schema "Chemical".

I've tried 4 different variations of this DBCC CHECKIDENT, and they all bring back the same error:

"Incorrect syntax near '.'"

I've tried:

DBCC CHECKIDENT (Chemical.[Products], RESEED, 0)  DBCC CHECKIDENT (Chemical.Products)  DBCC CHECKIDENT ([Chemical].[Products])  DBCC CHECKIDENT (Chemical.Products, RESEED, 0) 

Is it schema aware or what am I missing?

like image 260
Robert4Real Avatar asked Apr 23 '09 14:04

Robert4Real


People also ask

What does DBCC CHECKIDENT?

DBCC CHECKIDENT returns the current identity value and the current maximum value of the identity column. If the two values are not the same, you should reset the identity value to avoid potential errors or gaps in the sequence of values.


1 Answers

You can surround with single quotes or inside square brackets. Both work.

DBCC CHECKIDENT ('Chemical.Products', RESEED, 0) DBCC CHECKIDENT ([Chemical.Products], RESEED, 0) 
like image 142
Jose Basilio Avatar answered Oct 02 '22 20:10

Jose Basilio