Instantly share code, notes, and snippets.

Embed
What would you like to do?
use tempdb
go
-- membuat table dan stored procedure
create table radityo_coba1(kunci varchar(255),value text);
GO
CREATE PROCEDURE dbo.usp_mencoba1
as
begin
declare @jml_person int
select @jml_person = count(*) from AdventureWorks2012.Person.Person
insert into radityo_coba1(kunci,value) values ('jumlah person',cast(@jml_person as varchar))
end
go
-- menjalankan stored procedure dan melihat hasilnya
exec usp_mencoba1
select * from radityo_coba1
-- menghapus
drop table radityo_coba1
DROP PROCEDURE [dbo].[usp_mencoba1 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment