.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Post New Web Links


Posted By:      Posted Date: September 27, 2010    Points: 0   Category :Sql Server

According to the Adam Machanic's link http://sqlblog.com/blogs/adam_machanic/archive/2006/07/12/performance-isnull-vs-coalesce.aspx claims go both ways.

I could not confirm any difference. Performance measurement script follows:

 USE AdventureWorks2008;
DECLARE @StartTime datetime, @i int = 0
DECLARE @Duration TABLE (Duration int)
WHILE (@i < 100)
 SET @StartTime = GETDATE() 
 SELECT SalesOrderID, OrderDate, 
     Comment=COALESCE(Comment,'N/A') -- Cost: 0.620299
 FROM Sales.SalesOrderHeader
 INSERT @Duration

View Complete Post

More Related Resource Links

Isnull & Coalesce Linq


SELECT ISNULL(@foo, @bar) 


how do i convert this to Linq ??

SELECT ISNULL(@p1, @p2) 


Combine, minify and compress JavaScript files to load ASP.NET pages faster

Websites are getting more interactive these days and most of this interactivity comes from JavaScript. People are using different JavaScript libraries and frameworks to make their websites more interactive and user friendly.

Utility Spotlight: 12 Steps To Faster Web Pages With Visual Round Trip Analyzer


Download Visual Round-trip Analyzer (VRTA) to uncover the root of your Web page loading problems and identify these 12 common ailments.

Jim Pierson

MSDN Magazine November 2008

C++: Write Faster Code with the Modern Language Features of Visual C++ 2005


The next version of Visual C++ has a new syntax that is both elegant and powerful. It has new optimization technology that has improved the speed of Microsoft. It has new compilation modes that ensure Common Language Infrastructure compliance and verifiability for the .NET Framework, and it has new models for interop. In this article Stephen Toub explains these and other improvements to Visual C++.

Stephen Toub

MSDN Magazine May 2004

Visual Studio .NET: Build Web Applications Faster and Easier Using Web Services and XML


Visual Studio .NET includes exciting features, some of which are enhancements to previous versions and some of which are brand new. A few of the most significant additions are the new Microsoft programming language called C#; a new, smarter integrated development environment; new object-oriented features in Visual Basic .NET; and development lifecycle tools. This article provides an overview of these features, as well as a look at Web Services, Web Forms, and new versions of ADO and ASP. It takes a first look at dozens of important new Visual Studio features that aid in the design, development, testing, and deployment of solutions built with Visual Basic, C++, Visual FoxPro, and C#.

Dave Mendlen

MSDN Magazine September 2000

CAML with IsNull and and MultiChoice field

We are running into an issue combining a IsNull and EQ query on a single column combined with an OR. We are building the query using U2U, so its not a syntax error (presumably). Has anyone been able to do something like this: 1 column with multiple choices allowed Query against the column and try to find items where the value is either equal to something valid for the column OR null. The same behavior is exhibited with IsNotNull.

How to create Asynchronous website-make the site work faster?

Hi,I developed an ASP.NET 3.5 website to read a few XML files generated by a third party software and convert them to a single Excel Book. The entire process takes more than 1 HOUR and even before completing the entire work, the system comes back with a message like - "Page cannot be displayed" and it fails. So, I am planning to make this website an Asynchronous site (I think if I make this site asynchronous it will work faster and will not stop execution before completing - new ideas are welcome.) I am new to this concept. Can anyone help me with some examples of how to convert a normal website to Asynchronous website? At present my site has 3 tiers and the reading of XML pages and writing them into Excel are happening in the Data Access Layer.Thanks

open faster huge list of combobox

Hi All. In detail form I have combobox with some thousand rows. I preloaded collection view of this list in parent form and make equal collection view of parent form to collection view detail form for combobox. But still need wait approximately 5 second when list will open. How to do that list of combobox will open faster. Thanks.

for ajax data insertion in page what is faster than innerHTML ?

I m doing an ajax work where web service will return data and on client side and I am creating html table with data. I am using var (to hold string of generated html code), do string concatinations to generate table, tr and td tags and put data in it. Than I put this html table with data into a div using innerHTML. Please note I am applying inline css in this dynamic html code. The issue I am facing is web service will return a huge amount of data. What I tested is even on local machine it took about 10-12 minutes to process (concatinating, creating tags putting data in table, applying css) 10000 rows. Stored procedure just take 3-4 seconds in returning data. Please guide me how this inbrowser processing time can be reduced ? I am doing it for speed in some wrong way ? Or is there some technique for it or some method faster than innerHTML and string concatinations ? thanks

application is faster while SSMS is open !?

Hi,  I have my VB.Net 2010 win form app running a job on a table (35.000 rows). I read from an MS-Access Database and, while iterantig on an OleDbDatareader,  I write  to the SQL Server Express 2008R2 using SqlDbCommand.ExecuteNonQuery. A progress bar on the GUI shows the current row. I've noticed that, while the app is running, if I launch the SSMS and I perform an operation (i.e. a simple select on a table) against the same db,  the application goes much more faster. As  I close the SSMS, the application slows down. All this is running on the same PC. In both, application and SSMS, the SQL Server Server Authentication is used (same user). Here is the connection string, stored into the app.config file:   <add name="DB" connectionString="Data Source=localhost\sqlExpress;Initial Catalog=myDb;Integrated Security=False;User ID=myUser;Password=myPass;pooling=False;Connection Timeout=1200;"/> Any idea ? thanks in advance. Francesco

which is faster in web development C# or VB.NET


Hi everyone,


I want to ask which language is faster when deploying the website to the internet. I mwan which is faster for the user to browse to website? C# or VB.NET?

By the way, which one ASP.NET did use?


A strange use of COALESCE function



I'm reading the book Professional Sql Server Analyisis Service 2008 With MDX and I have encountred a strange use of the COALESCE function

SELECT * from Products where product_id >COALESCE(?,0) And

product_id <=COALESCE(?,-1)



This query is found In page  (881 of  1056). The authors trie to get data before last update. but what I personally know is that an expression is set instead of ?

I tried that above query and It gives me and error as I expected because ? makes no sens in my point of view, May does they mean that we put some expression there instead of ?. So the question is am I mising something if I use exactly the query without modifying any syntax

The complexity resides in the simplicity

ISNULL Function requires 2 Arguments



Decalre @international SMALLINT

I am Getting @International from some other table in my cursor

Then i am doing an Insert

The requirement is if @international is NULL it should be 'N'

If it is not null then it should insert @international value from what ever joined tables


Insert Into Table_XYZ

Values(1,'Abc','USA',ISNULL(@International,'N',@international) )


Error:THE ISNULL Function requires 2 Arguments....


Can some me helpm on this...





coalesce building pivot column headers - making them descending instead of ascending


Hi, I was somewhat surprised and happy to see that the t-sql statement below can be used to dynamically build my pivot column headers.   I was also surprised to see that either it is smart enought to build the headers alphabetically or I'm incredibly lucky.  Date is a char(7) column in my table with format yyyy/mm.

Anyway, it would be really cool for me if the headers were build descending instead of ascending.  I tried using a view to do this but the thing has a mind of its own.  I'll start writing a function but would like to know if the community knows of a better way. 

It generates a string that looks something like ...




@PivotColumnHeaders VARCHAR

Which is faster and how can I use Fiddler to concur?


What is faster, querying 1000 records from SQL Server 2005 or Querying 1000 records an XML Document? 


Is it faster to use this query with json or is it faster to query in C#/VB.net?


Telling the program what you won't be doing to make the code run faster


I need to know if my thinking is on the right track about something, and if so, what keywords I might Google search to find out more about this.

Are there times we write code and the real advantage is that by telling the computer what we won't be doing, it saves time because the computer doesn't have to do something (maybe saving milliseconds, or even more?)

For example, every discussion about the modifier 'abstract' explains how it will prevent me from accidently trying to instantiate an object from the class.  Well, I'm in a situation where I'm pretty sure I won't make that mistake, but then I was thinking, well, maybe there's a better reason to use 'abstract' -- maybe it tells the computer 'you don't have to do certain stuff because this an abstract class' and it creates a significant time savings.

Am I on the right track?

The closest I've come to finding this was a mention that it's good to mark classes with 'sealed' whenever you know you won't be inheriting from them; this was in article about making code work faster.

Thank you for your help with this.

Help needed with ISNULL Expression


I'm hoping someone can help me here.  I'm new to using the Derived Column Transformation Editor, and I have the task of tranforming a DB2 decimal column to a date SQL date column.  I already converted it to a string column, because I figured the best way to change it from their wacky way of dating to the correct way is through string manipulation.  The date format for DB2 is 1yymmdd (that's right, there's a 1 in front of it...don't ask me why, lol)

So I have the string format all correct.  This is the BASE expression;

SUBSTRING([Copy of ARRIVALDATE],4,2) + "/" + SUBSTRING([Copy of ARRIVALDATE],6,2) + "/" + SUBSTRING([Copy of ARRIVALDATE],2,2)

The result of the BASE expression is a date format; mm/dd/yy, but now I have a problem.  If the item has yet to arrive, it is null, and I cannot convert it to a date because if it is null I end up with two slashes.  (//).  Okay...so I tried this;

ISNULL([Copy of PRINTEDDATE]) ? " " : (SUBSTRING([Copy of PRINTEDDATE],4,2) + "/" + SUBSTRING([Copy of PRINTEDDATE],6,2) + "/" + SUBSTRING([Copy of PRINTEDDATE],2,2))

The problem is, I STILL end up with just two slashes even if it is null.  Could anyone help me in correctly forming this expression so that a null value will return a n

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend