SQL Flow Field Guide

LOG

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

math

What changes

Input
numeric arguments
Output or change
numeric value
Return type
float

Syntax at a glance

LOG ( float_expression [, base ] )

Work example

Calculate a logarithm using the natural or a selected base.

Test domain limits and the largest expected input. Keep degree and radian units explicit.

Check your work Require positive input and check the chosen base before using the result.

Open Microsoft Learn for full syntax, permissions, and details for your version.