Hi,
Has any one ever compared the performance of calling a DataTable's
Select method with a stored procedure doing the same thing?
My point is:
dataRows = DataTable.Selec t(filter) is better or
Passing paramters to stored procedure?
The datatable holds about 500-700 rows at any given time.
If I select one of the approaches the business logic will go into
respective layers.With dotnet in picture what would be a good approach
- Have the data in Datatable and do a filter on the data or call
stored procedures which has been the convention.
Can some one pl. suggest? 3 2137
"nandan" <ma****@hotmail .com> wrote in message
news:c7******** *************** ***@posting.goo gle.com... Hi, Has any one ever compared the performance of calling a DataTable's Select method with a stored procedure doing the same thing? My point is: dataRows = DataTable.Selec t(filter) is better or Passing paramters to stored procedure? The datatable holds about 500-700 rows at any given time.
If I select one of the approaches the business logic will go into respective layers.With dotnet in picture what would be a good approach - Have the data in Datatable and do a filter on the data or call stored procedures which has been the convention. Can some one pl. suggest?
In general, any sort of filtering will be faster on the server, where you
have an optimized database engine which can use indexes and caching to speed
up the operation. An exception to this might be where you return an initial
result set to the client, and then the client needs to filter within that
set, perhaps in several different ways. It might be more efficient to let
the client use the local Datatable in that case, instead of querying the
server for the same data every time, especially if bandwidth or concurrency
are issues. But I have to admit that I have very little understanding of how
Datatables work, so there may be other considerations also - you might want
to post this in an ADO or .Net group to get a better answer.
Simon
[posted and mailed, please reply in news]
nandan (ma****@hotmail .com) writes: Has any one ever compared the performance of calling a DataTable's Select method with a stored procedure doing the same thing? My point is: dataRows = DataTable.Selec t(filter) is better or Passing paramters to stored procedure? The datatable holds about 500-700 rows at any given time.
If I select one of the approaches the business logic will go into respective layers.With dotnet in picture what would be a good approach - Have the data in Datatable and do a filter on the data or call stored procedures which has been the convention. Can some one pl. suggest?
I have not made any actual performance, but it goes without saying
that if you get all rows from a table or a stored procedure, and
only intended to display a subset, that you should filter down in
SQL Server. This will reduce network traffic and memory consumption
on the client. It can also make the query perform considerably faster.
However, if you are giving the user the ability to change what data
he sees on the fly, it's another matter. Say that the user first
wants to see squared widgets, and then want to see green wdigets. Now
it makes more sense to get all widgets to the client, since else you
would have to requery for each new selection the user makes.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp
Erland Sommarskog <es****@sommars kog.se> wrote in message news:<Xn******* *************** @127.0.0.1>... [posted and mailed, please reply in news]
nandan (ma****@hotmail .com) writes: Has any one ever compared the performance of calling a DataTable's Select method with a stored procedure doing the same thing? My point is: dataRows = DataTable.Selec t(filter) is better or Passing paramters to stored procedure? The datatable holds about 500-700 rows at any given time.
If I select one of the approaches the business logic will go into respective layers.With dotnet in picture what would be a good approach - Have the data in Datatable and do a filter on the data or call stored procedures which has been the convention. Can some one pl. suggest? I have not made any actual performance, but it goes without saying that if you get all rows from a table or a stored procedure, and only intended to display a subset, that you should filter down in SQL Server. This will reduce network traffic and memory consumption on the client. It can also make the query perform considerably faster. However, if you are giving the user the ability to change what data he sees on the fly, it's another matter. Say that the user first wants to see squared widgets, and then want to see green wdigets. Now it makes more sense to get all widgets to the client, since else you would have to requery for each new selection the user makes.
Thank you very much for the information. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: TJ Olaes |
last post by:
Hello all, this is my second post to this newsgroup. It's a question
about stored procedures and permissions and how these behave between
databases.
Here's the scenario. I have a database that stores information for a
system "A", and I have a different database on the same SQL server
that stores the login and other info "LOGIN". I write a stored
procedure in the "A" database that checks some tables in the "LOGIN"
database, let's call...
|
by: nandan |
last post by:
Hi,
Has any one ever compared the performance of calling a DataTable's
Select method with a stored procedure doing the same thing?
My point is:
dataRows = DataTable.Select(filter) is better or
Passing paramters to stored procedure?
The datatable holds about 500-700 rows at any given time.
If I select one of the approaches the business logic will go into
respective layers.With dotnet in picture what would be a good approach
|
by: Dino L. |
last post by:
How can I run stored procedure (MSSQL) ?
|
by: Rob Wire |
last post by:
For the code below, how could I add an item in the drop
down lists for both company and location to be an "All"
selection that would send to the stored proc.
spRptAttachments a value of "%" so that it would bring
back all attachments at all companies or all locations at
a company? Thank you, Rob.
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
|
by: Rob Richardson |
last post by:
Greetings!
I am rewriting a VB6 application in VB .Net. The database (which was
converted from Access 97 into Access 2000) has two nearly identical queries.
One, called GetNewOrderNumber, is:
SELECT IIF ((SELECT COUNT(*) FROM Orders), Max(Order_number) + 1, 1) AS
NewOrderNumber
FROM Orders;
| |
by: John |
last post by:
Hi
When developing vb.bet winform apps bound to sql server datasource, is it
preferable to use SELECTs or stored procedure to read and write data from/to
SQL Server? Why?
Thanks
Regards
|
by: ric_deez |
last post by:
Hi there, I would like to create a simple search form to allow users to
search for a job number based on a number of parameters. I think I
understand how to use parameteres associated with Stored Procedures
with a data reader to add various parameters.
However, if I have a stored procedure such as
CREATE usp_SelectfromJobNumbers (@par1 datatype, @par2 datatype, @par3
datatype)
|
by: Bonzol |
last post by:
Hey there,
I think this is not actually VB, but the language im using is VB. Ive
been doing all my code,, NOT using Stored procedures.. so my functions
are like.(in 2003)
visual basic
code:--------------------------------------------------------------------------------
Public Function vLookup(ByVal table As String, ByVal returnColumn As
String, ByVal checkColumn As String, ByVal checkValue As String) As
|
by: =?Utf-8?B?VEQgaXMgUFNQ?= |
last post by:
I have a lookup table with and ID field and a Description field, and another
table that has its own ID field, the ID field from the lookup table, and
other data.
LookupTable
LookupTable.ID
LookupTable.Description
OtherDataTable
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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,...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |