Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Maths

Author  Topic 

leonr
Starting Member

15 Posts

Posted - 2011-11-17 : 06:56:41
I was wondering what is considered best practice, either doing calulcations client side, or within an SP?

Mainly basic currency calculations, nothing too crazy.
I suppose the downside is that if its serverside, it will slow the server down, however if its clientside it's harder to migrate the application to a web app for example.

What do people generally think on this? Thanks

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-11-17 : 08:07:04
Depends on what it is. If you do it in the dtaabase it's usually in one place and easy to check - especially if it's saved as a value. If the client does it then often it's in multiple places and not so easy to find problems but maybe easier to implement for isolated requirements.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

leonr
Starting Member

15 Posts

Posted - 2011-11-17 : 08:37:43
Yeh thats kind of what I figured to be honest, I was just wondering if theres a big 'no never do important calculations within a SP' , but it doesn't appear so :)

Thanks!
Go to Top of Page

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2011-11-17 : 08:54:54
SQL servers are generally much better at doing the heavy lifting.


Jim
Users <> Logic
Go to Top of Page

leonr
Starting Member

15 Posts

Posted - 2011-11-18 : 04:15:36
Thanks guys, i've been doing programming forever and .net for a while now, but SQL isn't something I use everyday.

Cheers!
Go to Top of Page
   

- Advertisement -