Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / July 2008

Tip: Looking for answers? Try searching our database.

SQL Server 2005 - Performance - Writing stored procedure in C# .Ne

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AtulSureka - 16 Jul 2008 09:56 GMT
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
Uri Dimant - 16 Jul 2008 10:33 GMT
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

>I have a stored procedure which is having multiple cursors. These cursors
>are
[quoted text clipped - 9 lines]
>
> Atul Sureka
Gert-Jan Strik - 20 Jul 2008 13:38 GMT
> I have a stored procedure which is having multiple cursors. These cursors are
> affecting the performance of SP.
[quoted text clipped - 7 lines]
>
> 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).

Signature

Gert-Jan
SQL Server MVP

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.