SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 reseed a table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

theboyholty
Posting Yak Master

United Kingdom
226 Posts

Posted - 04/03/2013 :  10:10:17  Show Profile  Visit theboyholty's Homepage  Reply with Quote
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

USA
5072 Posts

Posted - 04/03/2013 :  10:32:28  Show Profile  Visit russell's Homepage  Reply with Quote
use double quotes
DBCC CHECKIDENT ("central.dim_country", reseed, 0)
Go to Top of Page

theboyholty
Posting Yak Master

United Kingdom
226 Posts

Posted - 04/03/2013 :  11:56:03  Show Profile  Visit theboyholty's Homepage  Reply with Quote
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

USA
5072 Posts

Posted - 04/03/2013 :  12:51:44  Show Profile  Visit russell's Homepage  Reply with Quote
You're welcome. Glad to help.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.23 seconds. Powered By: Snitz Forums 2000