Anda di halaman 1dari 1

NAMA: WIRA INDRAYANA

NIM: 14157049
MENENTUKAN VOLUME BALOK
CREATE FUNCTION dbo.funcVolBalok
(
Add the parameters for the function here
@panjang int,@lebar int, @tinggi int
)
RETURNS INT
AS
BEGIN
Declare the return variable here
DECLARE @hasilvolume int;
Add the T-SQL statements to compute the return value here
SELECT @hasilvolume = (@panjang*@lebar*@tinggi);
Return the result of the function
RETURN @hasilvolume
END
GO
Untuk memanggil fungsi tersebut gunakan perintah seperti dibawah ini :
select dbo.funcVolBalok(10,5,2);
hasilnya adalah 200

Anda mungkin juga menyukai