Example: Cast between UDTs
Suppose you want to define a UDF that converts Canadian dollars to U.S. dollars.
Example: Comparisons involving UDTs
Suppose you want to know which products sold more in the U.S. than in Canada and Germany for the month of March, 2003 (3/03).
Example: Assignments in dynamic SQL
If you want to use the same statement given in the example: Assignments involving UDTs in dynamic SQL, you can use parameter markers.
Example: Assignments involving different UDTs Suppose you have defined two sourced UDFs
on the built-in SUM function to support SUM on U.S. and Canadian dollars,
similar to the UDF sourced on Euros in the Example: Sourced UDFs involving
UDTs.
Example: Use of UDTs in UNION Suppose you want to provide your
U.S. users with a query to show all the sales of every product of your company.