Financial Calculations in SQL

  • Could someone please share some information and some links on writing stored procedures for the calculation of different Financial information such as depreciation, Cost Analysis, Expense Forecasting, ect...

    I have been searching and not really finding anything for SQL.

    I believe on the Depreciation side, I am going to have the Depreciation schedule calculated when a new vehicle is entered and then store the depreciation schedule in the database. It seems like that makes more sense than recalculating it on the fly.

    I am not sure about forecasting, is cost forecassting similar to sales forecasting?

    Any help in this area would be appreciated.

  • I'm not surprised that you haven't found much, because I think you're asking the wrong question. SQL Server is a general purpose RDBMS, so it understands how to store, retrieve and update data, while financial accounting and forecasting are fairly specific applications built on top of some data storage mechanism, with a lots of rules as to HOW to manipulate/track that info over time. You can certainly build all of those accounting/financial features into a system that uses SQL Server, but there isn't anything specific to SQL Server that would directly facilitate those features.

    It's kind of like asking GM where the "self-drive to 123 main street in Newark NJ" button is on one of their cars. The car can certainly take your there - but you have to work to *make* the car get you there.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Well in this shop, data is stored and these are the topics I have to report off of. All SQL, no front in application to sit on top.

    Simple Depreciation is easy to calculate, and store. the rest I am still looking, hopefully someone out there has had to do this.

  • swoozie (4/14/2014)


    Well in this shop, data is stored and these are the topics I have to report off of. All SQL, no front in application to sit on top.

    Simple Depreciation is easy to calculate, and store. the rest I am still looking, hopefully someone out there has had to do this.

    SQL Server does not have these built in functions for complex accounting calculations. You have to calculate and store this information yourself.

    Things like Cost Analysis and Expense Forecasting are immensely complicated and have lots and lots of business rules for each company that wants this type of thing. You can write all of that into a stored procedure or something but you have to first identify what those rules are.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply