SQL Server SQYARDS Function
Updated 2023-11-08 21:00:52.253000
Description
Use the scalar function SQYARDS to convert from acres, hectares, square feet, square inches, square meters, square miles, or square yards to square yards.
Syntax
SELECT [westclintech].[wct].[SQYARDS] (
<@Area, float,>
,<@From_scale, nvarchar(4000),>)
Arguments
@Area
is any real number. @Area is an expression of type float or of a type that can be implicitly converted to float.
@From_scale
is the description of the units for @Area. @From_scale must be a valid value as specified in area unit representations. @From_scale must be of a data type that is implicitly convertible to varchar.
Return Type
float
Remarks
The following table is a representation of the conversion of one of the area units of measure into square yards:
| column 1 | column 2 |
|---|---|
| acres | 4840 |
| square inches | 0.000771605 |
| square feet | 0.111111111 |
| square yards | 1 |
| square miles | 3097600 |
| square meters | 1.19599005 |
| hectares | 11959.9005 |
Conversion of meters includes all the standard prefixes with kilo representing 1,000 and yocto representing 10E-24.
Examples
select wct.SQYARDS(100, 'yd^2');
Here is the result set.
| column 1 |
|---|
| 100 |