use demo1
go

drop table readings
drop function FahrenheitToCentigrade
drop function KilogramsToPounds
drop procedure AddToTemp
drop procedure AddAndReturnBoth
drop procedure AddAndReturnBothOut
drop assembly MetricConverter
go

-- create the assembly
CREATE ASSEMBLY MetricConverter
FROM 'c:\types\metricconverter.dll'
go

create procedure AddToTemp (@a float out, @b float)
as
external name MetricConverter.[MetricFunctions.MetricProcs].AddToTemp
go

create procedure AddAndReturnBoth (@a float, @b float, @c float out, @d float out)
as
external name MetricConverter.[MetricFunctions.MetricProcs].AddAndReturnBoth
go

create procedure AddAndReturnBothOut (@a float, @b float, @c float out, @d float out)
as
external name MetricConverter.[MetricFunctions.MetricProcs].AddAndReturnBothOut
go

-- try them out
declare @a float
declare @b float
declare @c float
declare @d float

set @a = 10
set @b = 20

exec AddToTemp @a out, 44
print @a

exec AddAndReturnBoth 22, 44, @c out, @d out
print @c
print @d

exec AddAndReturnBothOut 33, 44, @c out, @d out
print @c
print @d 