Red Gate forums :: View topic - Random error: A duplicate object name has been found
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

Random error: A duplicate object name has been found

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
vincentj



Joined: 17 Feb 2011
Posts: 36

PostPosted: Fri Mar 22, 2013 8:38 pm    Post subject: Random error: A duplicate object name has been found Reply with quote

We have a script that runs a comparison report between SVN and our production databases to make sure they stay in sync. However, it fails over 40% of the time with this error:

Quote:
A duplicate object name has been found. This may occur if the SQL Server that you are registering is case sensitive but the case sensitive option is not set.


We am not using any case sensitive options or collations. In fact, usually I can just re-run the report and it works the second time. It would be great if it at least told me what object was causing the comparison to fail, but I have no idea what causes this.

I reported a similar issue about a year ago but never found a solution, though I don't know for sure if these are related.

Any ideas?
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1144
Location: My desk.

PostPosted: Mon Mar 25, 2013 8:36 pm    Post subject: Reply with quote

Thanks for your post.

I'm afraid I can't think of any obvious reason why this message would happen and then not happen when you run the script again immediately afterwards.

You mentioned you're comparing to SVN - can you tell me a little more about how your script does this?

Asides from case sensitivity problems (which, if your DB isn't case sensitive, should be irrelevant) there are other possible causes such as two files in your scripts that contain a definition for the same object.

The other thing to try is to add the /logLevel:<logLevel> switch to your commandline script, and set it to "v" - this should create a more verbose log file that may contain further clues.

The logfile will be located in the usual location (c:\users\<username>\appdata\local\red gate\logs\sql compare 10)
Back to top
View user's profile Send private message
vincentj



Joined: 17 Feb 2011
Posts: 36

PostPosted: Fri Mar 29, 2013 4:33 pm    Post subject: Reply with quote

Our script checks out the branch from Subversion and then runs a command line comparison to generate the report. The command line looks something like this (with NAnt variable placeholders):

Code:

"D:\Red Gate\SQL Compare 10\SQLCompare.exe" /f /loglevel:Verbose /scr1:d:\build\Database\trunk\Standard /server2:${sqlcompare.server2} /database2:${sqlcompare.database2} /username2:${sqlcompare.username2} /password2:${sqlcompare.password2} /options:Default,IgnoreIdentitySeedAndIncrement,IgnoreStatistics /reporttype:Interactive /report:${report.filename}


Thanks for the tip about the log file. The report ran fine the past few days but we had another failure this morning. The log file doesn't seem to contain any information to help me identify which object is viewed as a duplicate. I looked at the extensive list of files that were processed and there are no duplicates there. Here is a snippet from the log file, maybe it's useful to somone at Redgate?

Code:

10:16:21.194|Verbose|Command Line        |1  |Argument /force has value 'True'
10:16:21.194|Verbose|Command Line        |1  |Argument /logLevel has value 'Verbose'
10:16:21.194|Verbose|Command Line        |1  |Argument /filter has value 'D:\build\Database\filters\comparefilter.scpf'
10:16:21.194|Verbose|Command Line        |1  |Argument /scripts1 has value 'D:\build\Database\DBReport\Standard'
10:16:21.194|Verbose|Command Line        |1  |Argument /server2 has value 'server3'
10:16:21.194|Verbose|Command Line        |1  |Argument /database2 has value 'prod3
10:16:21.194|Verbose|Command Line        |1  |Argument /username2 has value 'user'
10:16:21.194|Verbose|Command Line        |1  |Argument /password2 has value 'pw'
10:16:21.194|Verbose|Command Line        |1  |Argument /options has value 'Default;IgnoreIdentitySeedAndIncrement;IgnoreStatistics'
10:16:21.194|Verbose|Command Line        |1  |Argument /reporttype has value 'Interactive'
10:16:21.194|Verbose|Command Line        |1  |Argument /report has value 'D:\ReportArchive\reports_2013-03-29_10-07\trunk-server3.prod3.html'
10:16:21.194|Verbose|Command Line        |1  |
10:16:21.397|Verbose|Command Line        |1  |SQL Compare running with option: Default (OK).
10:16:21.397|Verbose|Command Line        |1  |SQL Compare running with option: IgnoreIdentitySeedAndIncrement (OK).
10:16:21.397|Verbose|Command Line        |1  |SQL Compare running with option: IgnoreStatistics (OK).
10:16:21.444|Verbose|Command Line        |1  |Comparing database Scripts.Standard with database server3.prod3...
10:16:24.085|Trace  |Source Control Link |5  |SQL Source control link successfully created
10:16:24.085|Info   |SQL Compare Engine  |5  |Register folder start: D:\build\Database\DBReport\Standard
10:16:24.100|Info   |SQL Compare Engine  |5  |Script folder database version: SqlServer2008
10:16:24.100|Info   |SQL Compare Engine  |5  |Script folder database collation: SQL_Latin1_General_CP1_CI_AS
10:16:24.194|Info   |SQL Compare Engine  |5  |Populate Folder Start.
[...processing files...]
10:16:40.774|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing.
10:16:40.883|Warn   |SQL Compare Engine  |5  |DBScriptResolver Warning db or server set, not resolving: server1.prod1.dbo.subscriber_to_event
10:16:41.227|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing triggers.
10:16:41.227|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing functions.
10:16:41.227|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing stored procs.
10:16:41.227|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing #8rg.#Bsg triggers.
10:16:41.227|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing #8rg.#2zg triggers.
10:16:41.227|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing ddl triggers.
10:16:41.227|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing permissions.
10:16:41.243|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing bindings.
10:16:41.243|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing udt fields and params.
10:16:42.055|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing partition schemes.
10:16:42.055|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing tables.
10:16:42.071|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing indexes.
10:16:42.134|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing fulltext columns.
10:16:42.149|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing udt scale and precision.
10:16:42.149|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing assembly dependancies.
10:16:42.165|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing foreign keys.
10:16:42.165|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing foreign key fields.
10:16:42.165|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing trigger order.
10:16:42.165|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing ddl trigger patchup.
10:16:42.165|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing role membership.
10:16:42.180|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing synonym dependancies.
10:16:42.180|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing dependency stacks.
10:16:42.274|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing messagetypes.
10:16:42.274|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing contracts.
10:16:42.274|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing queue event notifications.
10:16:42.274|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing queues.
10:16:42.274|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing services.
10:16:42.274|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing extended properties.
10:16:42.305|Info   |SQL Compare Engine  |5  |Populate Folder postprocessing sanitize dependencies.
10:16:42.337|Info   |SQL Compare Engine  |5  |Register folder finished: D:\build\Database\DBReport\Standard
10:16:42.462|Trace  |Source Control Link |5  |SQL Source control link successfully created
10:16:42.462|Info   |SQL Compare Engine  |5  |Register live database start: prod3
10:16:42.477|Info   |SQL Compare Engine  |5  |Populate Live Start, popoptions: DatabaseCollation, DecryptPost2kEncryptedObjects
10:16:42.493|Info   |SQL Compare Engine  |5  |Populate Live Start, options: Default, IgnoreIdentitySeedAndIncrement, IgnoreStatistics
10:16:42.634|Info   |SQL Compare Engine  |5  |Populate major version: SqlServer2005
10:16:42.649|Info   |SQL Compare Engine  |5  |Populate got casing: False
10:16:42.649|Info   |SQL Compare Engine  |5  |Populate Case Sensitive: False
10:16:44.165|Info   |SQL Compare Engine  |5  |Populate FulltextCatalogs start.
10:16:44.181|Info   |SQL Compare Engine  |5  |Populate Fulltext Stoplists start.
10:16:44.181|Info   |SQL Compare Engine  |5  |Populate Fulltext Stopwords start.
10:16:44.196|Info   |SQL Compare Engine  |5  |Populate ObjectNames start.
10:16:50.181|Error  |SQL Compare Engine  |5  |SqlCompareException: A duplicate object name has been found. This may occur if the SQL Server that you are registering is case sensitive but the case sensitive option is not set.
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at #8rg.#Ssg.#Glh()
   at #8rg.#Ssg.#vl(DBPopulationOptions #WXrc)
10:16:50.275|Fatal  |Command Line        |1  |A duplicate object name has been found. This may occur if the SQL Server that you are registering is case sensitive but the case sensitive option is not set.
RedGate.Shared.Utils.CommandLine.FatalExecutionException: A duplicate object name has been found. This may occur if the SQL Server that you are registering is case sensitive but the case sensitive option is not set. ---> RedGate.SQLCompare.Engine.SqlCompareException: A duplicate object name has been found. This may occur if the SQL Server that you are registering is case sensitive but the case sensitive option is not set. ---> System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at #8rg.#Ssg.#Glh()
   at #8rg.#Ssg.#vl(DBPopulationOptions #WXrc)
   --- End of inner exception stack trace ---
   at #8rg.#Ssg.#vl(DBPopulationOptions #WXrc)
   at RedGate.SQLCompare.Engine.Database.#crc(ConnectionProperties #Ap8b, #en #5OPb)
   at RedGate.SQLCompare.Common.CompareEngineExecutor.#DaH(Database #RHc, LiveDatabaseSource #ovUb)
   at RedGate.SQLCompare.Common.CompareEngineExecutor.#DaH(Database #RHc, DataSource #ovUb)
   at RedGate.SQLCompare.Common.CompareEngineExecutor.#8bH()
   at #dRb.#8Rb.#kco()
   at #dRb.#eRb.#Pao()
   --- End of inner exception stack trace ---
   at #namb.#tamb.#q1r(ExitCodes #M6rc, Exception #9Z)
   at RedGate.SQLToolsCommandLine.CommandProcessor.#Acmb(Exception #9Z)
   at RedGate.SQLToolsCommandLine.CommandProcessor.#Acmb()
   at RedGate.SQLToolsCommandLine.CommandProcessor.#ZjD()
   at RedGate.SQLToolsCommandLine.CommandProcessor.#kcmb()
   at RedGate.SQLCompare.CommandLine.CommandProcessor.#kcmb()
   at RedGate.SQLToolsCommandLine.CommandProcessor.#OUb()

Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1144
Location: My desk.

PostPosted: Mon Apr 01, 2013 10:28 am    Post subject: Reply with quote

Thanks for posting back- you're right, the error isn't telling us the object unfortunately.

When it happens again, can you immediately run the GUI and see if it reports the same problem? If it does (hopefully!) then you should see a link on the error message saying something like "Serious Error? Send an error report". If you do this (adding your email address where prompted) we should be able to then find it in our bug-tracker and it should give more 'under-the-hood' information including object names.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group