DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE
SITE SEARCH SQLUSA.com HEADLINES NEWS
SQL E/BOOKS   SQL 2014 PROGRAMMING   DOWNLOADS
SCRIPTS SQL 2005 SQL 2008 ARTICLES
SQL JOBS TWITTER FORMAT VIDEOS
How to build a mortgage refinance calculator?

Execute the following Microsoft SQL Server T-SQL script in SSMS Query Editor to find out the monthly payment for a 30-year fixed mortgage on 200,000 dollar principal with 5.5% interest rate:

declare @InterestRate money, @PeriodRate money, @Balance money
declare @Duration money, @Frequency money, @MonthlyPayment money

set @InterestRate=0.055
set @Frequency=12
set @[email protected]/@Frequency
set @Balance = 200000
set @Duration = 30


set @MonthlyPayment = ((@Balance*power([email protected],(@Duration*@Frequency)))*@PeriodRate)
/(power([email protected],@Duration*@Frequency)-1)

select [email protected], [email protected], [email protected]

Mortgage refinancing savings based on a refinancing a 30-year fixed mortgage of $200,000 with a 7.00% interest rate with a $200,000 mortgage at a 5.50% interest rate. The difference in payments is approximately $200 per month, or $2,400 annually. This analysis does not consider any closing costs or the effect of lengthening the term of the loan.



 

Exam Prep 70-461
Exam 70-461
DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE