Conflicts with SQL Server 2012 Sequence objects
riko
Posts: 9
I have create some sequence objects and successfully checked them into source control.
However, whenever I get latest, they are returned as conflicts, even thought the sequences in the database and source control are shown to be exactly the same.
E.g. (mine and theirs exactly the same):
Note: In this case, "identifier" is a custom type I have created and checked in:
When I select "theirs" and click the get latest button, it fails to run the script against the database, as it generates empty "ALTER" statements for the sequences, e.g.:
If I choose "Keep mine" and check the changes in, I am back to square one.
Please help!
However, whenever I get latest, they are returned as conflicts, even thought the sequences in the database and source control are shown to be exactly the same.
E.g. (mine and theirs exactly the same):
-- Sequence CREATE SEQUENCE [dbo].[seq_EnvID] AS identifier START WITH 1 INCREMENT BY 1 MINVALUE -9223372036854775808 MAXVALUE 9223372036854775807 NO CYCLE CACHE GO
Note: In this case, "identifier" is a custom type I have created and checked in:
CREATE TYPE [dbo].[identifier] FROM [bigint] NOT NULL.
When I select "theirs" and click the get latest button, it fails to run the script against the database, as it generates empty "ALTER" statements for the sequences, e.g.:
ALTER SEQUENCE [dbo].[seq_EnvID] GO
If I choose "Keep mine" and check the changes in, I am back to square one.
Please help!
Comments
This only happens after I add the sequences to source control. The error goes away again if I remove the sequences from source control, they are simply shown as "new objects" not yet checked in.
Please can you fix SQL Source Control for sequences? I am currently evaluating the product and cannot use it if it doesn't support sequences properly... after all it is almost 18 months since the SQL Server 2012 RTM...
Even though this is perfectly valid in SQL Server 2012, it is probably not supported by SQL Source Control?
This works:
This doesn't:
Can someone confirm this? And if it is an issue, is it something that will be fixed in the near future?
Thanks
Riko
I'll see if I can find out more...
Redgate Software
Unfortunately it doesn't look like this will get fixed in the immediate term; currently you're the only person to have hit this, so unless we start to see it happening a lot more from other users it'll not get looked at for a little while. It's actually a problem in the SQL Compare engine rather than SQL Source Control itself which unfortunately makes it a more involved fix.
Sorry to be the bearer of bad news, but thanks for bringing it to our attention.
Redgate Software
I guess I'll just ask my employer to cancel my SQL Toolbelt license in the "immediate term" shall I?
So I cannot use the migration scripts feature at all, which is more serious. Previously I could add sequences to my filter and ignore them for source control, which was a sensible workaround.
If not, then you should be able to bypass it, so there's probably a different issue. What's the scenario you're hitting that you need to use Migrations for, out of interest?
Redgate Software
I am currently creating a custom migration script by using a SQL Compare script as a starting point; it doesn't complain about my sequences.
In fact SQL Compare seems perfectly happy with my sequences - it can sync changes to the sequences, the objects that depend on them or the custom type being used in the sequences fine.
It's only SQL Source Control that gets itself all worked up [/code]
Out of interest, can you try running SQL Compare between your DB and its related Working Base folder? (to find that, right-click the URL you're linked to on the source control setup tab, and you'll see the option)
Redgate Software