StrataFrame Forum

SQL 2012 Support - Sequences?

http://forum.strataframe.net/Topic32257.aspx

By William Fields - 10/29/2013

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?

???
By StrataFrame Team - 10/30/2013

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

By William Fields - 10/30/2013

Perfect.

Thanks.