use chap3

CREATE Assembly PassBack from 'D:\YCourse\NewestBob\yukon11.27.03\chapter3 (CLR in SQL)\Samples\PassBack\PassBack\bin\Debug\PassBack.dll'
with permission_set = SAFE

drop PROCEDURE PassBack
Drop procedure passback3
drop procedure Passback2
drop assembly PassBack


CREATE PROCEDURE PassBack(@valueIn int, @valueOut int OUTPUT) as
 EXTERNAL NAME PassBack:CPB1::PB1

CREATE PROC PassBack3(@valueIn int = 5, 
@valueOut int OUTPUT) 
as EXTERNAL NAME PassBack:CPB1::PB1

CREATE PROC PassBack2(@valueIn int, @valueOut int OUTPUT) as
 EXTERNAL NAME PassBack:CPB1::PB1

DECLARE @i int
SET @i = 4
EXEC PassBack 3, @i OUTPUT
PRINT @i
GO

DECLARE @i int
SET @i = 4
EXEC PassBack @valueOut = @i OUTPUT, @valueIn = 3
PRINT @i
GO

DECLARE @i int
SET @i = 4
EXEC PassBack3 DEFAULT, @i OUTPUT
PRINT @i
GO


DECLARE @i int
SET @i = 4
PRINT '-' + Convert(varchar, @i) + '-'
EXEC PassBack2 null, @i OUTPUT
if(@i is NULL) print 'null'
if(@i is not NULL) print @i

exec PassChars 'asdf'

exec PassChars null
print 'got here'

sp_addlogin [NETWORK SERVICE]
