Wrox Programmer Forums
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 10th, 2006, 09:28 AM
Registered User
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default dynamic sproc

Hi, I am planing to use a sproc to insert records in the db. That said, the insertion process is to some extent dynamic. If the user has already subscribed to the enews on our site, and now is completing a full registration the insertion process will contain some updates. If this is the first time anything related to this user is being inserted, the full record is inserted. Also there is the dynamic situation of inserting the title, if the user did not provide a title, there is no insertion in the titles table etc. keep in mind that a Transaction must be used

What i need help on is which design is better to yield the highest performance
1- a sproc with if..else and the queries in between
2- scripting the different parts in separate queries and using if..else to excu them from the main sproc
3- scripting a number of sproc and using the server code (asp.net or whatever) to select the separate sprocs to use?

is it a good or bad thing to use Transaction in the sproc code itself?
Old August 25th, 2006, 06:23 AM
Registered User
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts

From the maintainence standpoint, using single SProc is better than 3, however performance-wise all three are same...Keeping transaction in SProc is much, much better than at front-end (after all it's the thing for which we use RDBMS !!!)

Harsh Athalye
"Nothing is impossible"

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with sproc Bob Bedell SQL Server 2005 10 January 20th, 2008 08:52 AM
Get sproc return value from ObjectDataSource Bob Bedell ASP.NET 2.0 Professional 3 January 19th, 2008 10:22 PM
When a sproc or table was Last Used dlandolin SQL Server 2000 1 September 29th, 2005 08:09 PM
Working with Dates in SPROC hugh@kmcnetwork.com SQL Language 4 March 10th, 2004 03:56 PM
Optional WHERE clause in sproc KYC SQL Language 2 February 17th, 2004 03:40 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.