/*
   20 Juni 201614:10:17
   User: 
   Server: (local)
   Database: GrpInsurance
   Application: 
*/

/* To prevent any potential data loss issues, you should review this script in detail before running it 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_PasienFollowUp
	(
	Detail_id int NOT NULL IDENTITY (1, 1),
	No_Pasien varchar(10) NOT NULL,
	Tgl_Data datetime NULL,
	Catatan varchar(400) NULL,
	Pengobatan varchar(400) NULL,
	Prosedur_Diagnosa varchar(400) NULL,
	Biaya float(53) NULL,
	Estimasi_Penjaminan float(53) NULL,
	Ekses_Klaim float(53) NULL,
	Create_By varchar(4) NULL,
	Create_Date datetime NULL,
	Change_By varchar(4) NULL,
	Change_Date datetime NULL
	)  ON [PRIMARY]
GO
ALTER TABLE dbo.Tmp_PasienFollowUp SET (LOCK_ESCALATION = TABLE)
GO
GRANT DELETE ON dbo.Tmp_PasienFollowUp TO public  AS dbo
GO
GRANT INSERT ON dbo.Tmp_PasienFollowUp TO public  AS dbo
GO
GRANT REFERENCES ON dbo.Tmp_PasienFollowUp TO public  AS dbo
GO
GRANT SELECT ON dbo.Tmp_PasienFollowUp TO public  AS dbo
GO
GRANT UPDATE ON dbo.Tmp_PasienFollowUp TO public  AS dbo
GO
SET IDENTITY_INSERT dbo.Tmp_PasienFollowUp ON
GO
IF EXISTS(SELECT * FROM dbo.PasienFollowUp)
	 EXEC('INSERT INTO dbo.Tmp_PasienFollowUp (Detail_id, No_Pasien, Tgl_Data, Catatan, Pengobatan, Prosedur_Diagnosa, Biaya, Create_By, Create_Date, Change_By, Change_Date)
		SELECT Detail_id, No_Pasien, Tgl_Data, Catatan, Pengobatan, Prosedur_Diagnosa, Biaya, Create_By, Create_Date, Change_By, Change_Date FROM dbo.PasienFollowUp WITH (HOLDLOCK TABLOCKX)')
GO
SET IDENTITY_INSERT dbo.Tmp_PasienFollowUp OFF
GO
DROP TABLE dbo.PasienFollowUp
GO
EXECUTE sp_rename N'dbo.Tmp_PasienFollowUp', N'PasienFollowUp', 'OBJECT' 
GO
COMMIT
