Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 reseed a table

Author  Topic 

theboyholty
Posting Yak Master

226 Posts

Posted - 2013-04-03 : 10:10:17
Hi I'd appreciate some advice here.
I'm trying to reseed a table.
Its not using the default schema and this seems to be giving me a problem.

When I use
DBCC CHECKIDENT (dim_country, reseed, 0)
without the schema reference, I get the message
Msg 2501, Level 16, State 45, Line 1
Cannot find a table or object with the name "dim_country". Check the system catalog.

When I employ the schema name and try
DBCC CHECKIDENT (central.dim_country, reseed, 0)
, I get the message

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '.'.


In order to avoid any obvious questions, the table does exist and I'm in the right database to start with. I also have the neccessary privileges to be able to do all this. I tried it with a table that was a dbo schema and it worked fine. Any ideas/suggestions would be greatly received.
Thanks.

---------------------------------------------------------------------------------
http://www.mannyroadend.co.uk A Bury FC supporters website and forum

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2013-04-03 : 10:32:28
use double quotes
DBCC CHECKIDENT ("central.dim_country", reseed, 0)
Go to Top of Page

theboyholty
Posting Yak Master

226 Posts

Posted - 2013-04-03 : 11:56:03
Got it. Thanks

---------------------------------------------------------------------------------
http://www.mannyroadend.co.uk A Bury FC supporters website and forum
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2013-04-03 : 12:51:44
You're welcome. Glad to help.
Go to Top of Page
   

- Advertisement -