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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Adding records with SPROCS

Author  Topic 

darenkov
Yak Posting Veteran

90 Posts

Posted - 2005-01-14 : 23:17:07
Hi,

I am new to stored procedures and have only been using them for retrieving data.

I have noticed that some people use them for adding records as well.

I am about to insert data into 7 small fields, ie name, surname, address, postcode etc. Can someone tell me if this is too small to bother using a sproc. Is there any benefit?

thanks

DustinMichaels
Constraint Violating Yak Guru

464 Posts

Posted - 2005-01-14 : 23:30:29
Alot of people think you should only access the database thru stored procedures and since your already using them for retrieving data you might as well make a stored procedure to insert information into it too.

Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-01-15 : 02:04:03
There are a lot of benefits when using stored procedures. You can read all about it on this forum and www.sql-server-performance.com . I wouldn't say anything is "too small" to use a stored procedure. That should be the only way you access the tables in the database 99.9% of the time. As you create stored procedures, try to thing about the global design. Limit how many procedures perform a common function (such as inserting data into your seven fields) as much as possible. The codebase will then be easier to maintain, the data will be easier to keep clean, etc.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
   

- Advertisement -