Skip to content

Instantly share code, notes, and snippets.

@radityopw
Created March 1, 2016 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radityopw/9496cbcea61fd8236df3 to your computer and use it in GitHub Desktop.
Save radityopw/9496cbcea61fd8236df3 to your computer and use it in GitHub Desktop.
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