SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Functions and SPROCS
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Robowski
Posting Yak Master

101 Posts

Posted - 06/25/2013 :  16:19:34  Show Profile  Reply with Quote
Anyone come across a sort of dummys guide article to using SPROCS, functions and views?

It seems inline/table valued functions, views and sprocs can often be used to return the same result but the main thing in SQL is performance and performance is key!

So I know you can use the query execution plan to analyse how each work and through experience learn what's best for when but is there sort of basic rules?

Like if you want to automate something to update something without the user having direct access you would use a SPROC for example...

Hope this make sense!

MuMu88
Aged Yak Warrior

547 Posts

Posted - 06/25/2013 :  22:13:17  Show Profile  Reply with Quote
There is nice YouTube video on this topic, titled:
Choosing Between Views, Functions, and Stored Procedures in SQL
http://www.youtube.com/watch?v=tdOiRT3HMxo

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/26/2013 :  02:08:11  Show Profile  Reply with Quote
It seems inline/table valued functions, views and sprocs can often be used to return the same result
why that can sometimes be correct, the usage of a particular type of module depends on certain other factors as well. For example if you need to use the resultset as a part of query with join/IN operation you may be better off using UDF over SProc. Similarly if you want a resultset based on parameter selection, use SPRoc over views etc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000