Hello all
Im using SQL Server 2005, ADO 2.9, OLEDB.
My question is;
Lets say we have 2 tables ITEMS and LOANS
When item is "checked out", i insert line into LOANS table and in ITEMS
table field state_id is changed from 1 to 3 using UPDATE ITEMS SET
STATE_ID=3 WHERE ID= Now, what is better for perfomance - INSERT and UPDATE querys are both in
source code (client side)
or INSERT is in source code and UPDATE using triggers on LOANS table using
AFTER INSERT?
Best Regards;
MeelisMeels
I'd go with single stored procedure . Clients just call it.
"Meels Lilbok" <meelis.lilbok@.deltmar.ee> wrote in message
news:B932E953-2275-47CD-8FCB-BC1A571B5F4B@.microsoft.com...
> Hello all
>
> Im using SQL Server 2005, ADO 2.9, OLEDB.
> My question is;
> Lets say we have 2 tables ITEMS and LOANS
> When item is "checked out", i insert line into LOANS table and in ITEMS
> table field state_id is changed from 1 to 3 using UPDATE ITEMS SET
> STATE_ID=3 WHERE ID=> Now, what is better for perfomance - INSERT and UPDATE querys are both in
> source code (client side)
> or INSERT is in source code and UPDATE using triggers on LOANS table using
> AFTER INSERT?
>
> Best Regards;
> Meelis|||The best solution is to create a great stored procedure that inserts/updates
into both tables and have the client app call the proc.
-Paul
"Meels Lilbok" <meelis.lilbok@.deltmar.ee> wrote in message
news:B932E953-2275-47CD-8FCB-BC1A571B5F4B@.microsoft.com...
> Hello all
>
> Im using SQL Server 2005, ADO 2.9, OLEDB.
> My question is;
> Lets say we have 2 tables ITEMS and LOANS
> When item is "checked out", i insert line into LOANS table and in ITEMS
> table field state_id is changed from 1 to 3 using UPDATE ITEMS SET
> STATE_ID=3 WHERE ID=> Now, what is better for perfomance - INSERT and UPDATE querys are both in
> source code (client side)
> or INSERT is in source code and UPDATE using triggers on LOANS table using
> AFTER INSERT?
>
> Best Regards;
> Meelis
Showing posts with label ado. Show all posts
Showing posts with label ado. Show all posts
Saturday, February 25, 2012
Friday, February 24, 2012
Best way to tell if a SP is a query Programatically
Using ADO.NET Or regular queries on SQL Server, is there a good way of
determining if a Stored Proc will be returning a result set or if it is
a non-query that does all I/O through parameters?
determining if a Stored Proc will be returning a result set or if it is
a non-query that does all I/O through parameters?
Thanks.Hi
You should know this when you program your data access routines and a
recordset needs to be declared to hold the resultset. If the parameters are
input/output/result then they need to be declared accordingly. You may look
at the syscolumns table that has a isoutparam column that will determine if
a parameter is an output parameter.
John
<wackyphill@.yahoo.com> wrote in message
news:1126884177.488723.219470@.g43g2000cwa.googlegr oups.com...
> Using ADO.NET Or regular queries on SQL Server, is there a good way of
> determining if a Stored Proc will be returning a result set or if it is
> a non-query that does all I/O through parameters?
> Thanks.
Subscribe to:
Posts (Atom)