View or Stored Proceedure?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    View or Stored Proceedure?

    Hope you can give me some advise.

    I am wanting to build a databse driven website. I am using Access to
    connect to an SQL 2000 server to create tables etc.

    I am using ASP/ASP.Net to build my site.

    The question I have is on best method to retrive data. Lets say I have
    a Table of Products, and one of those fileds is CurrentProduct and its
    True or False. On my web page I want to retreive and list all products
    that are marked as CurrentProduct True.

    I could do this as part of the SQL statement in the web page ie
    "Select * From Products Where CurrentProduct= True", I could create a
    View that only shows Current Products and use Select * From
    CurrentProducts View or I could create a stored prodceedure, that looks
    very much like a view.

    I know a bit about Access and Queries which is why I am using access
    to manage Sql, but very liitle if anything about Stored Proceedures.
    When should I use what? And what are the advantages / dis-advantages
    of each approach?

    Many thanks for any help you are able to provide.
  • Simon Hayes

    #2
    Re: View or Stored Proceedure?


    "John" <johnmartinwebb @hotmail.com> wrote in message
    news:9acad9ab.0 311200858.7242e c2f@posting.goo gle.com...[color=blue]
    > Hope you can give me some advise.
    >
    > I am wanting to build a databse driven website. I am using Access to
    > connect to an SQL 2000 server to create tables etc.
    >
    > I am using ASP/ASP.Net to build my site.
    >
    > The question I have is on best method to retrive data. Lets say I have
    > a Table of Products, and one of those fileds is CurrentProduct and its
    > True or False. On my web page I want to retreive and list all products
    > that are marked as CurrentProduct True.
    >
    > I could do this as part of the SQL statement in the web page ie
    > "Select * From Products Where CurrentProduct= True", I could create a
    > View that only shows Current Products and use Select * From
    > CurrentProducts View or I could create a stored prodceedure, that looks
    > very much like a view.
    >
    > I know a bit about Access and Queries which is why I am using access
    > to manage Sql, but very liitle if anything about Stored Proceedures.
    > When should I use what? And what are the advantages / dis-advantages
    > of each approach?
    >
    > Many thanks for any help you are able to provide.[/color]

    Stored procedures are usually the best way to retrieve data - see here for a
    good explanation of why:



    Simon


    Comment

    Working...