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
 Views or Stored Procedures in 2005???

Author  Topic 

richardlaw
Yak Posting Veteran

68 Posts

Posted - 2010-08-08 : 18:01:51
Hi

I don't really know a great deal about MS SQL. I know enough to get me by and that's about it.

I'm about to start on a large .Net website with a MS SQL 2005 database, and I'm really keen to build this using as much best practice as possible.

I've been searching the web for a while on this issue, and for every comment I see in favour of Views, I see another for SP's.

I'd really like to know, should I do everything using SP's in favour of security and speed, or are views fine also???

Many thanks
Richard

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-08-08 : 18:48:04
if you are using mssql for website, my best practice would be to use SP for all the web application commands (where you need to send/retrieve a special values) and a view (which is merely a select) is good for all the grid retrieving website builders.

With view you will find security very easy to handle (you focus on view and not on the tables that view uses) and it's good for different users to see different data.

view is as speedy as an ordinary select. as for procedure, it might be a bit lengthy if you include all the defaults sets.
Go to Top of Page
   

- Advertisement -