Hi there,
In a SP, I want to update table A based on values in table
B after data manipulation.
Which of the following option is better in the performance
point of view.
(1) Using Cursor
(2) Using 'table' datatype to hold one table
(3) Using temporary table instead of cursor.
Is there any other better approach exist?
Can 'table' datatype be used in 'Execute SQLTask' in DTS?
TIA,
HariHi
I would go with (2) but If you post DDL+ sample data + expected result it
will be more easily to olve the problem
Also consider
UPDATE tableA SET col=b.col1 FROM
tableB b JOIN tableA a on b.pk=a.pk
"sqlprogrammer" <anonymous@.discussions.microsoft.com> wrote in message
news:097901c397bb$25543520$a401280a@.phx.gbl...
> Hi there,
> In a SP, I want to update table A based on values in table
> B after data manipulation.
> Which of the following option is better in the performance
> point of view.
> (1) Using Cursor
> (2) Using 'table' datatype to hold one table
> (3) Using temporary table instead of cursor.
> Is there any other better approach exist?
> Can 'table' datatype be used in 'Execute SQLTask' in DTS?
> TIA,
> Hari|||I would also go for table datatype. But if you can share your code with us
then we can try to give you a better solution ... Did you look at using the
following syntax:
Update <TableA>
Set Col1 = <TableB>.Col1
Where <tableA>.id = <TableB>.id
something on these lines if you want to update a table comparing the values
from another table ...
--
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com
"sqlprogrammer" <anonymous@.discussions.microsoft.com> wrote in message
news:097901c397bb$25543520$a401280a@.phx.gbl...
> Hi there,
> In a SP, I want to update table A based on values in table
> B after data manipulation.
> Which of the following option is better in the performance
> point of view.
> (1) Using Cursor
> (2) Using 'table' datatype to hold one table
> (3) Using temporary table instead of cursor.
> Is there any other better approach exist?
> Can 'table' datatype be used in 'Execute SQLTask' in DTS?
> TIA,
> Hari
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment