create Function TestSize (@a varchar(max), @b DECIMAL(5, 4))
returns varchar(10)
as
BEGIN
DECLARE @v VARCHAR(10)
SET @v = 'asdf'
RETURN @v
END


select * from sys.parameters
where object_id = object_id('SizeTestCS')

select * from sys.assembly_modules
where object_id = object_id('Reverse')

select * from sys.all_objects
where Name = 'Reverse'


select * from sys.modules
where object_id = object_id('Reverse')


select * from sys.parameters
where object_id = object_id('Reverse')

select LDim::Reverse('asdf')
select dbo.Reverse2('asdf')

DROP FUNCTION Reverse3

CREATE FUNCTION Reverse3(@a varchar(max))
RETURNS INT
BEGIN
return 1
END

Drop Type LDim


select * from INFORMATION_SCHEMA.Routines
where Specific_name like '%reverse%'



DROP FUNCTION SizeTestCS


create Function SizeTestCS (@a nvarchar(10), @b DECIMAL(15, 4))
returns nvarchar(2)
as
EXTERNAL NAME Facets.UserDefinedFunctions.SizeTestCS



select dbo.SizeTestCS('asdf', 1.1)


DROP FUNCTION TestSize


DECLARE @d LDIM
DECLARE @s VARCHAR(MAX)
DECLARE @v SQL_VARIANT
--SET @v = LDim::Parse('1 ft')
SET @s = '1 ft'
SET @d = @s
select CAST(@d AS VARCHAR(MAX))


Select * from sys.assembly_types

select * from sys.data_spaces

select * from sys.dm_clr_properties

select LDim::Proptest
set LDim::Proptest = 3
select LDim::Proptest

DECLARE @a INT
set @a = LDim::IncContainer()
SELECT LDim::Proptest
