Created
August 16, 2011 06:57
-
-
Save azcoov/1148574 to your computer and use it in GitHub Desktop.
SQL Money Data Type Scale example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE | |
@mon1 MONEY , | |
@mon2 MONEY , | |
@mon3 MONEY , | |
@mon4 MONEY , | |
@num1 DECIMAL ( 19 , 4 ), | |
@num2 DECIMAL ( 19 , 4 ), | |
@num3 DECIMAL ( 19 , 4 ), | |
@num4 DECIMAL ( 19 , 4 ) | |
SELECT | |
@mon1 = 100 , @mon2 = 339 , @mon3 = 10000 , | |
@num1 = 100 , @num2 = 339 , @num3 = 10000 | |
SET @mon4 = @mon1 / @mon2 * @mon3 | |
SET @num4 = @num1 / @num2 * @num3 | |
SELECT | |
@mon4 AS moneyresult , | |
@num4 AS decimalresult |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment