473,786 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sql query or stored procudre which one is giving best performance in asp.net

hi all,
i have one doubt regarding queries and stored procedures.i am doing asp.net
project,i had written both query based retriving and stored procudures.I
want know about which one was giving best performance.and one more is when i
am passinf sql statement or stored procedure to sqlserver how these to
executed internally.
please tell me the answer these queries

thanks in advance
--
Best Regards,
TulasiKumar

Jan 12 '07 #1
2 1396
Stored procedures are better for performance. When you create one, SQL
server stores an execution plan with it. When you execute a SQL query
direct the database needs to create the execution plan each time. I think
more up-to-date versions of SQL Server have more advanced caching of these
things, I'm not that sure. SPs are also easier to write (I think) and
debug.

"tulasikuma r" <tu*********@we bsynergies.inwr ote in message
news:uX******** ******@TK2MSFTN GP03.phx.gbl...
hi all,
i have one doubt regarding queries and stored procedures.i am doing
asp.net project,i had written both query based retriving and stored
procudures.I want know about which one was giving best performance.and one
more is when i am passinf sql statement or stored procedure to sqlserver
how these to executed internally.
please tell me the answer these queries

thanks in advance
--
Best Regards,
TulasiKumar

Jan 12 '07 #2
bpd
And SP can be reused. They can also be changed without having to
recompile/deploy .Net code.
Aidy wrote:
Stored procedures are better for performance. When you create one, SQL
server stores an execution plan with it. When you execute a SQL query
direct the database needs to create the execution plan each time. I think
more up-to-date versions of SQL Server have more advanced caching of these
things, I'm not that sure. SPs are also easier to write (I think) and
debug.

"tulasikuma r" <tu*********@we bsynergies.inwr ote in message
news:uX******** ******@TK2MSFTN GP03.phx.gbl...
hi all,
i have one doubt regarding queries and stored procedures.i am doing
asp.net project,i had written both query based retriving and stored
procudures.I want know about which one was giving best performance.and one
more is when i am passinf sql statement or stored procedure to sqlserver
how these to executed internally.
please tell me the answer these queries

thanks in advance
--
Best Regards,
TulasiKumar

Jan 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
23627
by: Robert | last post by:
I am having performance issues on a SQL query in Access. My query is accessing and joining several tables (one very large one). The tables are linked ODBC. The client submits the query to the server, separated by several states. It appears the query is retrieving gigs of data from the table and processing the joins on the client. Is there away to perform more of the work on the server there by minimizing the amount of extraneous table...
3
5225
by: Paul Mateer | last post by:
Hi, I have been running some queries against a table in a my database and have noted an odd (at least it seems odd to me) performance issue. The table has approximately 5 million rows and includes the following columns: DocID (INTEGER, PRIMARY KEY, CLUSTERED) IsRecord (INTEGER, NONCLUSTERED)
11
5414
by: Eugenio | last post by:
Excuse me in advance fo my little English. I've got this stored procedure **************************************************************************** ********** declare @Azienda as varchar(3), @Utente as varchar(20), @DataDa as datetime, @DataA as datetime, @AreaDa as varchar(3), @AreaA as varchar(3),
3
2786
by: gizmo | last post by:
I have a stored procedure that queries a database using a Select statement with some inner joins and conditions. With over 9 million records it takes 1 min 36 sec to complete. This is too slow for my requirements. Is there any way I can optimize this query. I have thought about using an indexed view. I haven't done one before, does anyone know if this would have potential to improve performance or indeed any other performance...
10
3747
by: Thomas R. Hummel | last post by:
I have a stored procedure that suddenly started performing horribly. The query plan didn't look right to me, so I copy/pasted the code and ran it (it's a single SELECT statement). That ran pretty well and used a query plan that made sense. Now, I know what you're all thinking... stored procedures have to optimize for variable parameters, etc. Here's what I've tried to fix the issue: 1. Recompiled the stored procedure 2. Created a new,...
1
2345
by: Rhino | last post by:
I am trying to get a sense of requirements and best practices for Java stored procedures in DB2 V7.2 for Windows. 1. Is it required or recommended that any of the following be closed before leaving the stored procedure: open Statement and PreparedStatement objects; open ResultSet objects; open JDBC connections? Although the stored procedure will still run succesfully if these open objects and connections are not closed, are there any...
9
1127
by: Scott Reynolds | last post by:
Hi, I am using following code to read and generate SQL query based on values stored in ArrayList. But I am not sure if it is the best way... all suggestions are welcome! Thank you! Scott
29
5513
by: wizofaus | last post by:
I previously posted about a problem where it seemed that changing the case of the word "BY" in a SELECT query was causing it to run much much faster. Now I've hit the same thing again, where basically almost any change I make to how the query is executed (so that it still performs the same function) causes the performance to jump from a dismal 7 or 8 seconds to instantaneous. It's a very simple query of the form: SELECT Min(MyValue)...
7
2144
by: Ecohouse | last post by:
I'm working on a project that was dropped in my lap. It is in Access 2003. There are short time fields which get calculated values (eg. 1:30). But I will need to total up those values for reports in qiueries. When I tried to drop one of the fields in the query builder and used the total function the totals was way off. So I was wondering what would be the best way to do this? Thanks in advance for the help.
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10169
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.