/* To prevent any possible data loss problems, you should review this script carefully before running the script outside the context of the Database Designer. */
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT on
SET Numeric_roundabort OFF
SET Concat_null_yields_null on
SET ANSI_NULLS on
SET ansi_padding on
SET ansi_warnings on
COMMIT
BEGIN TRANSACTION
GO
CREATE TABLE dbo. Tmp_trans
(
ID int not NULL IDENTITY (1, 1),
Trans_time datetime NULL,
Sales Decimal (2) NULL
) on [PRIMARY]
GO
ALTER TABLE dbo. Tmp_trans SET (lock_escalation = TABLE)
GO
SET IDENTITY_INSERT dbo. Tmp_trans on
GO
IF EXISTS (SELECT * from Dbo.trans)
EXEC (' INSERT into dbo '. Tmp_trans (ID, trans_time, sales)
SELECT ID, trans_time, sales from Dbo.trans with (HOLDLOCK Tablockx) ')
GO
SET IDENTITY_INSERT dbo. Tmp_trans OFF
GO
DROP TABLE Dbo.trans
GO
EXECUTE sp_rename N ' dbo. Tmp_trans ', N ' trans ', ' OBJECT '
GO
COMMIT
Modify Column Identity