Created
March 1, 2016 04:09
-
-
Save radityopw/c5088d1870973432fd6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use tempdb | |
go | |
-- membuat stored procedure | |
CREATE PROCEDURE dbo.usp_mencoba1 @min_len_middle_name int , @max_len_middle_name int, @jml int out | |
as | |
begin | |
select @jml = count(*) from AdventureWorks2012.Person.Person where len(middleName) between @min_len_middle_name and @max_len_middle_name | |
end | |
go | |
-- menjalankan stored procedure dan melihat hasilnya | |
declare @jml_person int | |
exec usp_mencoba1 3,100,@jml_person output | |
print @jml_person | |
exec usp_mencoba1 2,100,@jml_person output | |
print @jml_person | |
exec usp_mencoba1 5,100,@jml_person output | |
print @jml_person | |
-- menghapus | |
DROP PROCEDURE [dbo].[usp_mencoba1 ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment