Comments
10 comments
-
Hi,
There's a few things that can cause this. Usually though, it's because you have duplicate definitions somewhere for one or more objects. This can happen if you have maybe made a backup copy of one of the files in SVN? If you click the "Send error report" option and enter your email address I can see if it contains further information.
The other possibility is when you have objects that differ in name only in whitespace. I think we changed the default to not be a problem any more, but you can double check by running this query:SELECT * FROM sys.sysobjects a INNER JOIN sys.sysobjects b ON REPLACE(RTRIM(LTRIM(a.name)),' ','') = REPLACE(RTRIM(LTRIM(b.name)), ' ','') AND a.id <> b.id
Any results from that can potentially cause the error as well. -
Hi James,
I've sent the error report to you.
That SQL did return some results but it makes no sense to me!fn_cdc_get_all_changes_ ... 606065345 fn_cdc_get_all_changes_... 574065231 fn_cdc_get_net_changes_ ... 622065402 fn_cdc_get_net_changes_... 590065288
That's name and id from the result
Thanks
Kind regards
Sidharth -
They may cause the problem. Basically, those will be four functions. You'll see that for each pair, they are named the same asides from a space between the _ and the ...
The default behaviour of SQL Source Control used to be (and may still be) that it ignores whitespace, so essentially you end up with two functions being seen as the same thing. That leads to the error.
Do you know if you definitely need all four of those functions? It looks more like one of each is either a typo or created in error... if you can remove the files for the problematic ones from SVN then re-link your database the problem may well go away. I'll keep an eye open for the error report if that refers to different objects though. -
Hi James,
Thanks for the reply. I've not created those functions! That's very strange. I'll see if deleting it from SVN fixes that problem - I have to leave just now though so it'll next week when I check this.
Thanks and kind regards
Sidharth -
No worries - let us know how you get on
-
Hi James,
I think I've found the problem. I had enabled Change Data Capture and DB Auditing for the database and that must've caused SQL Source Control to stop working. I've removed all objects from SVN, relinked and it's worked. And I've also disabled and removed all CDC objects. Hopefully that should work now.
However, I may need to enable CDC in the future - can you confirm Source Control works with CDC enabled?
Kind regards
Sidharth -
Interesting - I'm not aware of any issues with CDC, and I've managed to enable it on a database myself without any issue.
More likely is that by clearing up your SVN contents, you've removed whatever rogue file had a duplicate object definition in it. -
Hi James,
Okay, that's good to know. Thanks for all your help.
Kind regards
Sidharth -
I have the same error, though sometimes it alternates to this one: "A duplicate definition was found for the table [dbo].[#tmpErrors]". I am using the same version but with TFS. When I ran the query you mentioned above, I had 94 rows. I haven't had this problem before though. I tried unlinking and re-linking the database from TFS, but that didn't fix it. How do I resolve the problem?
Thanks! -
The query will return items that differ only in whitespace and are probably being treated as identical (what version are you on?)
It's unusual to get this message for something like temporary tablenames like that though; unless those definitions are in their own file or something?
Add comment
Please sign in to leave a comment.
I've got SQL Source Control 3.0.6.25 but only today I've started getting a strange error on one of my version controlled databases (SVN btw).
Any ideas how I can fix this?
Kind regards
Sidharth