![]() |
|
Spaces home Srini's BookmarksPhotosProfileFriendsMore ![]() | ![]() |
Srini's Bookmarks
May 23 SQL Prompt - free download - for now (out of beta)p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman';}
span.EmailStyle17
{font-family:Arial;color:windowtext;}
@page Section1
{size:8.5in 11.0in;margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
I find this tool to enhance productivity.
http://www.njsql.org/blogs/sql_server_fyi/archive/2006/05/22/40.aspx
http://wwwred-gate.com/products/SQL_Prompt/index.htm
May 04 Common patterns posters to decorate with by Raymond LewallenCommon patterns posters to decorate with by Raymond Lewallen
April 12 TECH: Integrating Electronic Payment Processing into ASP.NET Web ApplicationsA great article on E-Payment processing...
April 07 ASP.NET Application and Page Life Cycle Overviewp.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman';}
span.EmailStyle17
{font-family:Arial;color:windowtext;}
@page Section1
{size:8.5in 11.0in;margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
ASP.NET Application Life Cycle Overview: ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_aspnetcon/html/de0d8a1c-b1bc-48e1-b246-26e32289a82f.htm
ASP.NET Page Life Cycle Overview: ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_aspnetcon/html/7949d756-1a79-464e-891f-904b1cfc7991.htm
April 05 Useful .NET Tools and UtilitiesI will be listing some of the .NET tools and utils that I find useful.
NDepend: http://www.ndepend.com/
NCover: http://ncover.org
nDumpster: http://ndumpster.sourceforge.net
PowerCollections: http://wintellect.com
IIS Admin for XP Pro: http://www.firstserved.net/services/iisadmin.php
March 24 .NET Coding GuidelinesMicrosoft's Internal
Coding Guidelines: http://blogs.msdn.com/brada/articles/361363.aspx TECH: OR Mapperhttp://sourceforge.net/projects/ojb-net/ OJB.NET enables you to easily transfer data between your middle-tier .NET objects and a relational database. OJB.NET enables you to reverse-engineer your database schema, to automatically generate .NET domain-model classes, and to query and persist instances of these classes at runtime. Developer ProductivityOJB.NET dramatically improves your productivity by:
TECH: NSurveyTECH: NSurvey
TECH: A Visual Studio add-in that automates Assembly Version control.TECH: A Visual Studio add-in that automates Assembly Version control.
http://www.codeproject.com/dotnet/VersioningControlledBuild.asp TECH: Improving .NET Application Performance and Scalability (1150 pages)TECH: Improving .NET Application Performance and Scalability (1150 pages)
TECH: The Entity-Relationship ModelShortcut to: http://www.utexas.edu/its/windows/database/datamodeling/dm/erintro.html TECH: How Content Management Server 2002 Processes PagesHere's a great article you might be interested in:Find
developer information about Microsoft Office applications, servers, and
technologies.Learn what happens when a request for a Web page on a Microsoft
Content Management Server (MCMS) site comes in to the Web server, and how MCMS,
Microsoft ASP.NET, and Microsoft Internet Information Services (IIS) handle
these requests.
TECH: T-SQL StandardTECH: T-SQL Standard
From: http://msdn.microsoft.com/sql/default.aspx?pull=/library/en-us/dnsqlpro04/html/sp04l9.asp T-SQL Coding Standards Coding standards are often overlooked when it comes to T-SQL programming, but they're a crucial component of a smoothly operating development team. The coding standards I espouse here are ones that I've developed over the years. No, they're not universally accepted, and, admittedly, some of them are subjective. My message is really more about raising awareness than promoting myself as an arbiter of T-SQL style: The most important thing is to establish some reasonable coding standards and adhere to them. What you'll find in this article is a series of miscellaneous coding standards, hints, and tips for T-SQL programming. They're not arranged in any particular order of priority or importance. Let's start with formatting. On the surface, the formatting of T-SQL code may not seem that important, but consistent formatting makes it easier for colleagues–be they fellow team members or members of the larger worldwide T-SQL fraternity–to scan and understand your code. T-SQL statements have a structure, and having that structure be visually evident makes it much easier to locate and verify various parts of the statements. Uniform formatting also makes it much easier to add sections to and remove them from complex T-SQL statements for debugging purposes. Here's a formatting example for a SELECT statement: SELECT C.Name SELECT @Retain = @@ERROR, @Rows = @@ROWCOUNT IF @Status = 0 SET @Status = @Retain ► Capitalize all T-SQL keywords, including T-SQL functions. Use mixed case for variable names and cursor names. Use lowercase for data types. ► Keep table name aliases short, but as meaningful as possible. In general, use the capital letters of a table name as an alias and use the AS keyword to specify aliases for tables or fields. ► Always qualify field names with table name aliases when there are multiple tables involved in a T-SQL statement. This adds clarity for others and avoids ambiguous references. ► Align related numbers into columns when they appear in contiguous lines of code, such as with a series of SUBSTRING function calls. This makes the list of numbers easier to scan. ► Use single (not double) blank lines to separate logical pieces of T-SQL code, and do so liberally. ► Always specify the length of a character data type, and make sure to allow for the maximum number of characters users are likely to need, since characters beyond the maximum length are simply lost. ► Always specify the precision and scale of the decimal data type, which otherwise defaults to an unspecified precision and integer scale. ► Employ error handling, but bear in mind that the error-checking examples in BOL don't work as advertised. The T-SQL statement (IF) used to check the @@ERROR system function actually clears the @@ERROR value in the process and will never capture a value other than zero. (Even if the examples did work, they'd only capture the last error that occurred rather than what is likely to be of more interest–the first error.) The error code must be captured immediately using SET or SELECT as in the preceding example. It should then be transferred to a status variable if the status variable is still zero. ► Avoid using "undocumented" features such as undocumented columns in system tables, undocumented functionality in T-SQL statements, or undocumented system or extended stored procedures. ► Do not rely upon any implicit data type conversions. For example, don't assign a character value to a numeric variable assuming that T-SQL will do the necessary conversion. Instead, use the appropriate CONVERT function to make the data types match before doing a variable assignment or a value comparison. Another example: Although T-SQL does an implicit and automatic RTRIM on character expressions before doing a comparison, don't depend on that behavior because compatibility level settings and use of nchar complicate things. ► Do not directly compare a variable value to NULL with comparison operators (symbols). If the variable could be null, use IS NULL or IS NOT NULL to do a comparison, or use the ISNULL function. ► Don't use the STR function to perform any rounding; use it with integers only. Use the CONVERT function (going to a different scale) or the ROUND function before converting to a string if the string form of a decimal value is needed. CEILING and FLOOR are other options. ► Be careful with mathematical formulas, since T-SQL may force an expression into an unintended data type. Add point zero (.0) to integer constants if a decimal result is desired. ► Never depend on a SELECT statement returning rows in any particular order unless the order is specified in an ORDER BY clause. ► In general, use an ORDER BY clause with any SELECT statement. A predictable order, even if it's not the most convenient one, is better than an unpredictable order, especially during development or debugging. (You may want to remove the ORDER BY clause before deployment to production.) In those situations where the order of the resulting rows really doesn't matter, don't bother with the overhead of an ORDER BY. ► Don't ever use double quotes in your T-SQL code. Use single quotes for string constants. If it's necessary to qualify an object name, use (non-ANSI SQL standard) brackets around the name. ► As much as possible, use table variables in place of temporary tables with SQL Server 2000. If the table variable will contain a large set of data, be aware that indexing is very limited (primary key index only). ► Create temporary tables early in the routine, and explicitly drop them at the end. Interspersed DDL and DML statements can contribute to excessive recompile activity. ► Recognize that temporary tables are not inherently evil, and considered use of them can make some routines much more efficient–for example, when a certain set of data from a large or heavily used table will be referenced repeatedly. However, for a one-off, a derived table may be a better choice. ► Be cautious with table-valued UDFs, because passing in a parameter with a variable, rather than a constant, can result in table scans if the parameter is used in a WHERE clause. And avoid using the same table-valued UDF more than once in a single query. Table-valued UDFs do, however, have some dynamic compilation features that can be handy. [Related: See Tom Moreau's use of a UDF to populate a table variable in his November 2003 column on generating sequence numbers.–Ed.] ► Almost every stored procedure should have SET NOCOUNT ON near the beginning, and it's good form to have SET NOCOUNT OFF near the end. [SET NOCOUNT ON eliminates SQL Server's sending DONE_IN_PROC messages to the client for each statement in a stored procedure.–Ed.] This standard also applies to triggers. ► You should consider declaring an explicit transaction any time more than one database modification statement is used in a routine. This includes a single statement executed multiple times in a loop. ► Always look for a set-based solution to a problem before implementing a cursor-based approach or a temporary table approach. A set-based approach is usually more efficient. ► Cursors, like temporary tables, aren't inherently evil. A FAST_FORWARD cursor over a small set of data will often outperform other methods of handling row-by-row processing. This is especially true if several tables must be referenced to get the necessary data. A routine that includes "running totals" in the result set often executes fastest when implemented using a cursor. If development time allows, try both a cursor-based approach and a set-based approach to see which one performs best. ► A table of sequence numbers, 1 through N, can be very handy. ► I'll wrap things up with this observation: T-SQL code tends to be concise, so if a block of code looks unwieldy or repetitive, there's probably a simpler and better method. Conclusion Sidebar: From Karen's February 2000 Editorial
TECH: Collections too slow? When to write your own basic typesTECH: Collections too slow? When to write your own basic types From… http://blogs.msdn.com/ricom/archive/2005/02/16/374167.aspx Collections too slow? When to write your own basic types Rule #1: Don’t do it So, seriously, just don’t. Rule #2: Do it if data volume demands specialization Rule #3: Do it if call volume demands specialization Rule #4: Do it if exotic threading disciplines are required for scale Rule #5: Do it if strict control over memory or exceptions is critical Rule #6: Report performance issues in the regular classes whenever you can Summary: Have careful measurements and clear verifiable goals for success before proceeding You might start with ideas like “Hmm, I think I could do this with less memory if I roll my own” but I strongly caution you to not stop there. Have strong data to back your position or chances are you’ll get nothing but aggravation. Remember, if you are delivering a small component into someone else’s larger system, you probably shouldn’t build your own low level implementations. But if you are a medium or large team delivering a complete subsystem or application, and you can devote real bodies to the problem, then you might be able to justify the investment. posted on Wednesday, February 16, 2005 12:50 AM
TECH: CSS Cheat SheetTECH: CSS Cheat Sheet
|
|
||||||||
|
|