// SQL Server error reference

SQL Server error 8114: Error converting data type

SQL Server couldn't convert a value from one data type to another, often a varchar to numeric conversion or a parameter of the wrong type.

Error number
8114
Severity
16
Category
Data conversion and truncation
Error message
Error converting data type %ls to %ls.

What it means

Error 8114 is a general conversion failure, raised for example when a string can't be converted to numeric or decimal, or when a value passed to a stored procedure parameter doesn't fit the parameter's type. The message names the source and target types (Error converting data type varchar to numeric).

Common causes

  • Converting text that isn't a valid number, such as '1,234.50' or '12abc', to decimal or numeric.
  • Passing a string to a numeric procedure parameter: EXEC dbo.SetPrice @Price = 'free'.
  • Regional formatting: a decimal comma ('12,5') where SQL Server expects a decimal point.

How to fix it

  1. Find the values that don't convert.

    SELECT Amount FROM staging.Payments WHERE TRY_CONVERT(decimal(18, 2), Amount) IS NULL AND Amount IS NOT NULL;
  2. Clean formatting before converting, or parse with a culture.

    SELECT TRY_PARSE('12,5' AS decimal(18, 2) USING 'de-DE');
  3. Pass parameters with the right types from the application instead of strings.

Reproduce it safely

SELECT CAST('12abc' AS decimal(10, 2));  -- Msg 8114: Error converting data type varchar to numeric.

Related errors

More data conversion and truncation errors

The code and message text are from the Microsoft Database Engine events and errors reference. Browse the full SQL Server error list or search every database error.

// fewer errors, faster fixes

Work on SQL Server in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQL Server and the other databases you use.