Why am I getting an error when calling my stored procedure?
this fails:
exec dbo.foo 100
but it works:
exec dbo.foo 99
definition:
CREATE PROCEDURE dbo.foo ( @latitude DECIMAL (16,14) ) AS BEGIN PRINT 'OK' END
error message:
Msg 8114, Level 16, State 1, Procedure foo, Line 0 Error converting data type int to decimal.
decimal (16.14) means "16 digits, 14 after the decimal point . " This means 2 to the decimal point. "100" is out of range because it is 3 numbers ...
Quick example
DECLARE @fail decimal(16, 14), @pass decimal(17, 14) BEGIN TRY SET @pass = 100 END TRY BEGIN CATCH PRINT 'Will not see this' END CATCH BEGIN TRY SET @fail = 100 END TRY BEGIN CATCH PRINT 'Will see this' END CATCH
, , , . DECIMAL , ; 16. - , . , 100 DECIMAL(16,14), 99.99999999999999.
DECIMAL
DECIMAL(16,14)
Source: https://habr.com/ru/post/1792350/More articles:CSS - absolute position and document flow - csshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1792346/how-to-pass-arguments-to-saved-sbcl-core&usg=ALkJrhg2UzCY34yPUrjopCos4hjLBC1zwgCorrect type listing (or any other method) for Java Generic Class - javaHow to use buildapp with predefined asd file - executableSmartGwt DateItem useTextField = true - how to make the text input field Uneditable - dateMany-to-many odd behavior in symfony 1.4 forms with doctrine - formsПроблема с браузером даты - если вручную изменить и сосредоточиться на ней - не сэкономить - dateHow to get an exclusive firebird database lock to perform schema changes? - c #Problems with the pixel scaling algorithm using a graphical shader - shaderSmartGWT - date display in the format yyyy / MM / dd - dateAll Articles