Commits

Victor Shih committed 5213058

Handle optional seed and increment attributes.

Comments (0)

Files changed (1)

sqlserver_ado/compiler.py

             # Determine datatype for use with the table variable that will return the inserted ID            
             pk_db_type = meta.pk.db_type(self.connection)
             # Strip CHECK and IDENTITY properties
-            pk_db_type = re.sub(r'\b(?i)(check|identity)\b', '', pk_db_type)
+            pk_db_type = re.sub(r'\b(?i)(check\b|identity\b(\s*\([\s\d,]+\))?)', '', pk_db_type)
             
             # NOCOUNT ON to prevent additional trigger/stored proc related resultsets
             sql = 'SET NOCOUNT ON;{declare_table_var};{sql};{select_return_id}'.format(