Open fjtello opened 7 years ago
DECLARE @max as int; SET @max = (SELECT MAX(idLog) FROM logs); IF(@max is null) SET @max = 0; SET @max = @max + 1;
DECLARE @sqlCommand nvarchar(1000) SET @sqlCommand = 'alter sequence seq_logs restart with ' + CONVERT(VARCHAR(16), @max) + ';';
EXECUTE sp_executesql @sqlCommand;
DECLARE @max as int; SET @max = (SELECT MAX(idLog) FROM logs); IF(@max is null) SET @max = 0; SET @max = @max + 1;
DECLARE @sqlCommand nvarchar(1000) SET @sqlCommand = 'alter sequence seq_logs restart with ' + CONVERT(VARCHAR(16), @max) + ';';
EXECUTE sp_executesql @sqlCommand;