|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I have a stored procedure which is having multiple cursors. These cursors are
affecting the performance of SP. With SQL Server 2005 we can write the SP in C#. If I replace those cursors with for/while loop of C# code then will there be any performance benefit with it? Can anybody tell me what internally happens when we write code in C#? How it process the C# code? Atul Sureka |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Hi
> With SQL Server 2005 we can write the SP in C#. If I replace those cursors > with for/while loop of C# code then will there be any performance benefit > with it? Have you tried it? > Can anybody tell me what internally happens when we write code in C#? How > it > process the C# code? It is SQL Server forum, you will better of to ask in C# newsgroup "AtulSureka" <atul@mimosasystems.com> wrote in message news:C422A088-960C-4CF1-9CF6-160CD3D8DFF0@microsoft.com... >I have a stored procedure which is having multiple cursors. These cursors >are > affecting the performance of SP. > > With SQL Server 2005 we can write the SP in C#. If I replace those cursors > with for/while loop of C# code then will there be any performance benefit > with it? > > Can anybody tell me what internally happens when we write code in C#? How > it > process the C# code? > > Atul Sureka |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
AtulSureka wrote:
> > I have a stored procedure which is having multiple cursors. These cursors are > affecting the performance of SP. > > With SQL Server 2005 we can write the SP in C#. If I replace those cursors > with for/while loop of C# code then will there be any performance benefit > with it? > > Can anybody tell me what internally happens when we write code in C#? How it > process the C# code? > > Atul Sureka Atul, I don't have the answers to your questions. However, if multiple cursors give you unsatisfactory performance, then I would suggest you eliminate some or all of the cursors, and replace them with a set based solution. Set based solutions are typically orders of magnitude faster than equivalent cursor approaches. If there is performance benefit in rewriting the T-SQL code in C#, I would expect the difference to be marginal (at least in comparison with a set based approach). -- Gert-Jan SQL Server MVP |
|
![]() |
| Outils de la discussion | |
|
|