Logo

SQL Server TEASPOONS Function

Updated 2023-11-09 16:30:50.597000

Description

Use the scalar function TEASPOONS to convert from barrels (US beer barrels), bbl (oil barrel), bushels, cubic feet, cubic inches, cubic meters, cubic miles, cubic yards, cups, dry pints, dry quarts, fluid drams, fluid ounces, gallons, gills, imperial gallons, imperial gills, imperial pints, imperial quarts, liters, pecks, pints, quarts, steres, tablespoons or teaspoons to teaspoons.

Syntax

SELECT [westclintech].[wct].[TEASPOONS] (
  <@Volume, float,>
 ,<@From_scale, nvarchar(4000),>)

Arguments

@Volume

is any real number. @Volume 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 @Volume. @From_scale must be a valid value as specified in volume 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 volume units of measure into teaspoons:

column 1column 2
teaspoon1
tablespoon3
fluid dram0.75
fluid ounce6
cup48
pint96
quart192
gallon768
cubic inch3.3246753
cubic foot5745.039
cubic yard155116.05
cubic mile8.457E+14
imperial ounce5.764562
imperial pint115.29124
imperial quart230.58248
imperial gallon922.32992
barrel (beer)23808
barrel (oil)32256
bushel7149.4487
gill24
imperial gill28.822798
peck1787.3622
dry pint111.71013
dry quart223.42026
stere202884.14
liter202.88414
cubic meter202884.14

Conversion of metric values (liters and cubic meters) includes all the standard prefixes with kilo representing 1,000 and yocto representing 10E-24.

Examples

select wct.TEASPOONS(1, 'quart');

Here is the result set.

column 1
192