SP Technique --

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

    SP Technique --

    I'm a newbie when it comes to the SQL Server side of things. I've been doing
    Access on and off for years.

    I've got a form that is the main point of entry for all data.

    As a matter of technique, should I use one stored procedure to validate data
    (testing for uniqueness mostly) then another one to actually write the data
    to the tables?

    Does it make a difference one way or another to the performance?

    Do I gain any flexibility in my app dong it that way (Access Data Project)?

    Your help is appreciated.

    --Jake


  • John Bell

    #2
    Re: SP Technique --

    Hi

    How your stored procedures are constructed will depend on how you wish to
    use them!! If there is a requirement to validate data on it's own (e.g in an
    event for a given field) then you should write a single procedure that does
    that, of course you would need to re-validate it before committing the data
    to the database. This may use the same procedures, but then if you can
    combine validation it will be more efficient. Large amounts of code in your
    procedures may make it more likely to be recompiled, therefore splitting
    them up may reduce that. There is also the issue of maintainance, which is
    more difficult if you use a less modular approach to designing your stored
    procedures.

    HTH

    John

    "Jake Jessup" <watcherdude@ho tmail.com> wrote in message
    news:Jb5Cc.7640 0$dn5.13798@new ssvr29.news.pro digy.com...[color=blue]
    > I'm a newbie when it comes to the SQL Server side of things. I've been[/color]
    doing[color=blue]
    > Access on and off for years.
    >
    > I've got a form that is the main point of entry for all data.
    >
    > As a matter of technique, should I use one stored procedure to validate[/color]
    data[color=blue]
    > (testing for uniqueness mostly) then another one to actually write the[/color]
    data[color=blue]
    > to the tables?
    >
    > Does it make a difference one way or another to the performance?
    >
    > Do I gain any flexibility in my app dong it that way (Access Data[/color]
    Project)?[color=blue]
    >
    > Your help is appreciated.
    >
    > --Jake
    >
    >[/color]


    Comment

    • William Cleveland

      #3
      Re: SP Technique --

      You shouldn't need to code tests for uniqueness. The database
      structure should take care of that automatically, throwing errors
      if you violate it.

      Bill



      Jake Jessup wrote:
      [color=blue]
      > I'm a newbie when it comes to the SQL Server side of things. I've been doing
      > Access on and off for years.
      >
      > I've got a form that is the main point of entry for all data.
      >
      > As a matter of technique, should I use one stored procedure to validate data
      > (testing for uniqueness mostly) then another one to actually write the data
      > to the tables?
      >
      > Does it make a difference one way or another to the performance?
      >
      > Do I gain any flexibility in my app dong it that way (Access Data Project)?
      >
      > Your help is appreciated.
      >
      > --Jake
      >
      >[/color]

      Comment

      Working...