Best Way to Update a SQL Server DB
Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=1276
Printed Date: 29 March 2026 at 2:53pm Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: Best Way to Update a SQL Server DB
Posted By: ChubbyArse
Subject: Best Way to Update a SQL Server DB
Date Posted: 24 March 2003 at 5:09am
Hi all,
I would like to know what the consensus of opinion is regarding the best method to employ to update a SQL Server database from an ASP page. The mitigating factors are that there will be many people updating and add new records throughout the day, and many people running reports using crystal webreports.
From where I'm standing there are the following options:
1. Open an ADO recordset based on the table and update the fields of either a new record, or an existing record. 2. Use a UPDATE or INSERT INTO SQL string. 3. Use stored procedure and an ADO command object.
What is the best option in terms of locking, do Stored procedure insert and update quicker than using a recordset? I'm basically looking for the most robust and secure method to update a database.
Cheers Alex
|
Replies:
Posted By: Flamewave
Date Posted: 24 March 2003 at 5:19pm
From my experience stored procedures are the fastest way of accessing/modifying/creating data in an SQL server. As far as security goes, I don't know of any advantages/disadvantages in any of the three methoods you described that aren't the same for each one.
------------- - Flamewave
They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.
|
Posted By: Bunce
Date Posted: 26 March 2003 at 12:51am
Number 3 is also more secure. You can apply object permissions to the Stored Procedure, limit SQL injection through parameters, etc.
------------- There have been many, many posts made throughout the world...
This was one of them.
|
|