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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Best SQL Recommendation

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :Sql Server

Hi Guys,

I have 2 (two) tables at this point of time i.e. main_result and update_result.

main_result has 10+ columns and 2 of them are "pk" (which is primary key) and "name". The update_result table contains records that need to be updated to the main_result table and it only has 2 columns i.e. "pk" and "name". So, logically, I need to only update the name in the update_result table which has the same pk as the main_result table.

What would be the best and fastest SQL for me to update all the name in the update_result to the main_result? Considering that I have over 10 million records with many indexes in the main_result table.



View Complete Post

More Related Resource Links

Auto Index Recommendation


Hi everybody,

While reading msdn blogs, I found one nice script from sql server query optimization team.That is for automating index recommedation. Here is the link.


Is there anybody who has tried that one? If then pl tell me about it's results and pro & cons.



SharePoint Extension Type Recommendation



I am considering several extension options to overcome some of the limitations of the built-in web services. I looked at custom web services, .wsp solution packages, and web parts. What is the most commonly used extension method by customers? since this will be used by other organizations I'd like to use the most common extension method. Are there other extension options that let me access all sharepoint objects from a remote machine?

Any recommendations/suggestions will be highly appreciated.



SSMS - Index build suggestion/recommendation



Sometimes back we remember having used one feature within SSMS whereby after running a query, we can right click and get an option that recommends what index need to built for the query to perform faster. But as far as we can recall it is not 'Analyze query in database engine tuning adviser'. We are unable to recall what option was enabled or used. Can some help in finding that option. Thank you.

Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.


What is the exact meaning of OleDB error "Connection failure" and handling recommendation?

Hi, I am not sure if I can ask this question appropriately.  I'm a novice in OleDB programming.

I'm now maintaining a piece of C++ code which uses OleDB to connect to SQL2k5.  The program creates an OleDB connection to the SQL server and continously to execute SQL command via the connection without any problem until we get an OleDB error.  Using CDBErrorInfo::GetBasicErrorInfo() to get the error information, it shows that hrError = 0x80004005 and dwMinor = 0; and using CDBErrorInfo::GetAllErrorInfo() to get the other details of the error record, it gives me a description of "Connection failure".  Now could anyone please help to tell me what exactly does this error mean ?  Does it mean the connection between my program and the SQL server has broken ?  And how shall I handle/recover it in the code ? Should I just throw the existing connection away and recreate new OleDB connection ?

Thank you very much


Recommendation for WCF client proxy caching


Today we add a service reference to the WCF endpoint from the client. Using that reference we  creating newMyServiceClient to get a client proxy to be able to access the endpoint.

I would like to cache the client proxy that will be shared amounts different threads, so I guess I need a ReaderWriterLock when creating a new instance of a proxy. I have seen several different examples on the net how to cache the client proxies, so I'm a little bit confused about that is the best practice.

Do anybody have any recommended example code for this caching?

The Putative Microsoft recommendation (for security) Causes De-installer Malfunction



Control Panel/Programs/Programs and Features lists <product-name> as an installed product. When I click on <product-name> I get a choice to Change or Repair.
As I want to Remove I click Change. This leads to three radio buttons Modify, Repair, Remove. I click Remove.
At the end of the process <product-name> remains in the aforementioned list of installed products.
This has been repeated many times to include Repair in advance of Remove with no difference.
This, of course, is incorrect behavior and prevents me from bringing <product-name> up in service.

It is the mechanism of the Windows Installer (in the setup logic the prerequisite is that you must have Admin Right) but since Vista , the admin rigths are not really set
unless you 'RUN AS ADMINISTRATEUR) and in the Microsoft recommendation (for security) , you do not have to give error message for access denied
(that why you think that all is correct even if not)
I am not sure it is very clear but it is now the Microsoft philosophy since Vista

Is this actual and true Microsoft philosphy?  If so, it leads to program malfunctions and bad practice.  I launch the de-installer from Control Panel where I am
not even aware that I am launching a program much less have the option to launch it in a privileged mo

time out recommendation for NamedPipeClient Stream


Hi, I am not sure if this question should go here, if not please let me know.

I have an application that needs to communicate with another information to get some information.

Because of the possibility that it does not get the information, it applies a default value if it fails.

For a number of reasons, we chose to use NamedPipes for this. It does work well.

The idea was that the child app. (the one running the client side) was going to be launched after a parent application that runs the server stream.

But there is a problem, some times the parent application might not be running, either because it was shutdown for some reason or because the child application was launched without it (the only dependency between the two is the named pipes).

So I need to make sure the client app is not waiting indefinitely for a pipe that does not exist and will not exist.

I passed a timeout value to the constructor and then if I get a timeout exeption I return the default value.

My question is, considering that both applications will be running on the same machine, what's an adequate timeout value. I have set it up at 3 seconds, it does feel long, I dont' want the app. to wait too long when the server does not exist, but also I don't want it to ignore the pipe just because the timeout wasn't long enough.


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