Running the dbcc checkident
command in SQL Server Management Studio, trying to reset the identity column. As you can see in the picture below clearly my table exists and the schema is the default dbo. But when attempt to execute:
dbcc checkident (Article, RESEED, 4);
I get the following response from the query:
Msg 2501, Level 16, State 45, Line 1
Cannot find a table or object with the name "Article". Check the system catalog.
This happens for every table in all of my databases. But this one is the specific one I'm trying t开发者_Python百科o use. The table does have data in it. What can I do/check?
From the comments it seems your script window is running in the context of the master
database. You need to change the context to your database either by changing the value in the dropdown or running the below.
use mattsblog;
dbcc checkident (Article, RESEED, 4);
NB: In SSMS each script window represents a different connection. You can look in the status bar to see things like the current database context, user name, and spid
for each window.
精彩评论