Robert4Real
Robert4Real

Reputation: 1402

DBCC CHECKIDENT -- Schema aware?

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?

Upvotes: 26

Views: 10314

Answers (2)

Jose Basilio
Jose Basilio

Reputation: 51548

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

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

Upvotes: 47

Eoin Campbell
Eoin Campbell

Reputation: 44306

Try surrounding it in single quotes

DBCC CHECKIDENT ('Chemical.Products', RESEED, 0)

Upvotes: 6

Related Questions