SQL 2012 Support - Sequences?


Author
Message
William Fields
William Fields
StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)
Group: StrataFrame Users
Posts: 80, Visits: 239
Hello,

Will explicit support for sequence objects be added in the next DDT version?

I realize that a post-update script can be added that let's me do whatever I want, but it also sounds like a lot of work to maintain. Do you have any examples of how this is done?

???
StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Yes, explicit support for sequences will be included in the next version of the DDT as well as the option to use "NEXT VALUE FOR" instead of IDENTITY for the specification of a column.  

As for creating one through a post-deploy script, you can create the script with an IF NOT EXISTS clause in front of it like so:

IF NOT EXISTS(SELECT * FROM sys.sequences SQ INNER JOIN sys.schemas SC ON SQ.schema_id = SC.schema_id WHERE SQ.name = 'MySequence' AND SC.name = 'dbo')

       CREATE SEQUENCE dbo.MySequence START WITH 2 INCREMENT BY 2 CYCLE NO CACHE


William Fields
William Fields
StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)
Group: StrataFrame Users
Posts: 80, Visits: 239
Perfect.

Thanks.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search