Sample methods

The sample Address and Address2Line classes have instance methods named toString( ), and the sample Misc class has static methods named stripLeadingBlanks( ), getNumber( ), and getStreet( ). You can invoke value methods as functions in a value expression.

declare @name varchar(100)
declare @street varchar(100)
declare @streetnum int
declare @A2 Address2Line
 
select @name = Misc.stripLeadingBlanks(name), 
		@street = Misc.stripLeadingBlanks(home_addr>>street),
		@streetnum = Misc.getNumber(home_addr>>street),
		@A2 = mailing_addr
	from emps
	where home_addr>>toString( ) like '%Shoreline%'

For information about void methods (methods with no returned value) see “Type and void methods”.