Thursday, October 27, 2022

.::: insert Query to test Replica SQL Server from Publisher to Subscription :::.


1. run query
-- run in primary/publisher
select @@SERVERNAME as ServerName,* from raju.dbo.pembelian;

-- run in subscription
select @@SERVERNAME as ServerName,* from raju_replica.dbo.pembelian

 


2. run in primary/publisher
select * from pembelian;
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E001','ELK-01','J-0001','2002-05-20',3);    
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E002','ELK-01','J-0001','2002-05-21',4);    
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E003','ELK-01','J-0002','2002-05-20',2);    
 


3. run query again
-- run in primary/publisher
select @@SERVERNAME as ServerName,* from raju.dbo.pembelian;

-- run in subscription
select @@SERVERNAME as ServerName,* from raju_replica.dbo.pembelian


4. run in primary/publisher
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E004','ELK-01','B-0001','2002-05-20',2);    
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E005','ELK-01','B-0002','2002-05-22',3);    
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E006','ELK-02','J-0001','2002-06-24',1);    
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E007','ELK-02','J-0002','2002-06-24',1);    
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E008','ELK-02','B-0001','2002-06-25',2);
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E009','ELK-02','B-0002','2002-06-25',2);
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E010','ELK-03','J-0001','2002-06-20',5);
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E011','ELK-03','J-0002','2002-07-02',4);
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E012','ELK-03','B-0001','2002-07-02',6);
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E013','ELK-03','J-0001','2002-07-10',5);
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E014','ELK-04','J-0002','2002-07-15',12);
insert into pembelian(KODE_PEMBELIAN,KODE_BARANG,KODE_CUSTOMER,TANGGAL_PEMBELIAN,JUMLAH_PEMBELIAN) values('BEL-E015','ELK-04','B-0002','2002-07-17',15);
select * from pembelian;
 
5. run query again
-- run in primary/publisher
select @@SERVERNAME as ServerName,* from raju.dbo.pembelian;

-- run in subscription
select @@SERVERNAME as ServerName,* from raju_replica.dbo.pembelian


6. run query delete in primary
-- run in primary/publisher
delete from raju.dbo.pembelian;
select @@SERVERNAME as ServerName,* from raju.dbo.pembelian;
 
7. run query in standby
-- run in subscription
select @@SERVERNAME as ServerName,* from raju_replica.dbo.pembelian

 



No comments:

Post a Comment

Popular Posts