USE [AAB]
GO
BEGIN TRANSACTION
GO
/****** Object: Table [dbo].[Mst_Vehicle_ModelBrand] Script Date: 1/19/2017 1:35:31 PM ******/
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'dbo'
AND TABLE_NAME = 'Mst_Vehicle_ModelBrand')
BEGIN
DROP TABLE [dbo].[Mst_Vehicle_ModelBrand]
END
GO
/****** Object: Table [dbo].[Mst_Vehicle_StatusUpload] Script Date: 1/19/2017 1:35:31 PM ******/
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'dbo'
AND TABLE_NAME = 'Mst_Vehicle_StatusUpload')
BEGIN
DROP TABLE [dbo].[Mst_Vehicle_StatusUpload]
END
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.SFN_GET_DATADOWNLOAD_MARKET_PRICE') AND type in (N'IF'))
DROP FUNCTION [dbo].[SFN_GET_DATADOWNLOAD_MARKET_PRICE]
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.SP_GET_DOWNLOAD_MARKET_PRICE') AND type in (N'P'))
Drop PROCEDURE[dbo].[SP_GET_DOWNLOAD_MARKET_PRICE]
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.SP_GET_UPDATE_MARKET_PRICE') AND type in (N'P'))
drop PROCEDURE[dbo].[SP_GET_UPDATE_MARKET_PRICE]
Go
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.SP_SAVE_ERROR_MARKET_PRICE') AND type in (N'P'))
drop PROCEDURE [dbo].[SP_SAVE_ERROR_MARKET_PRICE]
Go
DECLARE @IsTesting INT
SET @IsTesting = 1 -- Ubah menjadi 0 jika testing berhasil dan jalankan kembali
IF @IsTesting = 1
BEGIN
Select 'ROLLBACK'
ROLLBACK TRANSACTION
END
ELSE
BEGIN
SELECT 'COMMIT'
COMMIT TRANSACTION
END
GO
BEGIN TRANSACTION
GO
/****** Object: Table [dbo].[Mst_Vehicle_ModelBrand] Script Date: 1/19/2017 1:35:31 PM ******/
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'dbo'
AND TABLE_NAME = 'Mst_Vehicle_ModelBrand')
BEGIN
DROP TABLE [dbo].[Mst_Vehicle_ModelBrand]
END
GO
/****** Object: Table [dbo].[Mst_Vehicle_StatusUpload] Script Date: 1/19/2017 1:35:31 PM ******/
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'dbo'
AND TABLE_NAME = 'Mst_Vehicle_StatusUpload')
BEGIN
DROP TABLE [dbo].[Mst_Vehicle_StatusUpload]
END
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.SFN_GET_DATADOWNLOAD_MARKET_PRICE') AND type in (N'IF'))
DROP FUNCTION [dbo].[SFN_GET_DATADOWNLOAD_MARKET_PRICE]
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.SP_GET_DOWNLOAD_MARKET_PRICE') AND type in (N'P'))
Drop PROCEDURE[dbo].[SP_GET_DOWNLOAD_MARKET_PRICE]
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.SP_GET_UPDATE_MARKET_PRICE') AND type in (N'P'))
drop PROCEDURE[dbo].[SP_GET_UPDATE_MARKET_PRICE]
Go
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.SP_SAVE_ERROR_MARKET_PRICE') AND type in (N'P'))
drop PROCEDURE [dbo].[SP_SAVE_ERROR_MARKET_PRICE]
Go
DECLARE @IsTesting INT
SET @IsTesting = 1 -- Ubah menjadi 0 jika testing berhasil dan jalankan kembali
IF @IsTesting = 1
BEGIN
Select 'ROLLBACK'
ROLLBACK TRANSACTION
END
ELSE
BEGIN
SELECT 'COMMIT'
COMMIT TRANSACTION
END
Comments
Post a Comment