Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Totally out of my depth
Message
From
07/04/2011 18:19:18
 
 
To
07/04/2011 17:57:41
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01506238
Message ID:
01506511
Views:
38
Good advice for many areas. I'm currently porting C++ code to C#. Because the C++ code is a work-in-progress, I tried to make the C# code mirror the original code as much as possible (varible names, methods, etc.). But there was one section of code I just didn't understand. Finally I went to the original author, got the info in English, and wrote it the "C# way" in short time. I'm currently testing it.

>When faced with this kind of code which probably "just grew" my first reaction is to ignore the code completely and start out by defining, in English, exactly what I am trying to accomplish. Once I can articulate just what I am trying to accomplish I can start looking at the procedure to see what parts can just be refactored into a user defined function. ( with the appropriate performance caveat - see the suggestions regarding CTE - a way to see it is only evaluated once )
>
>Then start building the select, testing performance as you go.
>
>And of course check the execution plan as you build each refinement into the select
>
>IOW, don't start with attempting to fix what you have - just use it for guidance as you think about the best way to do it right.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform