.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

TSQL 'IF EXISTS' appears to be running indefinately!!!

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :Sql Server

 FROM dbo.TransactionItems AS T WITH (NOLOCK) 
  INNER JOIN dbo.UnitTillMaps AS UTM WITH (NOLOCK) ON T.Unit = UTM.Unit
   AND T.BusDate >= UTM.StartBusDate
   AND T.BusDate <= UTM.EndBusDate 
 WHERE   (T.PLU = '123') AND (UTM.TillMap = 'ABCD'))
 SELECT 'Exists' AS Col

-- dbo.TransactionItems rows = 475,114,017 - adding roughly 400,000 rows a day, partitioned on Date, by Year.
-- dbo.UnitTillMaps rows = 756 - almost static - non-partitioned.

-- This was running up until 2 days ago fine.

--There are no locks, blocks, wait types or resource issues - status is Runnable and CPU and Physical IO keep going up.

--The SELECT statement by itself runs in under a second and returns 388 rows.

--Server and SANS have been powered down and restarted
--SQL Server 2005 SP2 on Windows Server 2003 SP1 8*dual core CPUs, 32Gig of memory with 28Gig allocated to SQL

--I have execution plans that look fine, but can't attach them to this message.

View Complete Post

More Related Resource Links

How to verify SSS is up and running from C# and verfiy Target Application if not exists then Create



I would like to know, How programatically in C# I can verify on SharePoint2010 Server that the SSS Service is up and running (Start), Also I need to verify if the Target Application does not exists then I the code create a New Target Application using C# and create/add some custom fields into it including default Login Name and Password fields. I found the same in PowerShell http://gallery.technet.microsoft.com/ScriptCenter/en-us/a88f7b6e-9c9e-475f-afd1-c68c4ef3cc4a but I have to customize it further. Also can I execute this PowerShell code under C# code? if yes then how?

Please help.


Shamshad Ali.

.NET problem - no text appears when not running under hosting process


I have the most annoying problem with .NET Framework 4 (both full and Client Profile).

Basically, when I debug my application under the hosting process (vshost), the problem doesn't occur. I've found it only when I ran the .exe directly from it's location, and now I see that it happens when I debug it as well, but not under hosting process.

The problem is that I cannot see any text inside the labels, inside message-boxs (even the Yes-No text from the buttons has dissapered), from buttons or text-boxs, it simply dissapears.

I tried creating a new .NET Framework 4 project, and the problem didn't appear. So I decided to re-create my application from scratch (almost from scratch). I've created a new solution file, new project files and included the .cs and .resx files from my previous solution. The problem persisted.

Interesting thing is though, that on my first solution I've changed the configuration platform to 'Any CPU' from 'x86', and the problem then appeared in either cases (even while running under the hosting process).

I wrote the app in VS2010. I am running on Windows 7 Professional 64-bit, SP1.


Please help!

Show grand total running total in GridView Footer

In many scenarios we need to display Running total as well as Grand total in GridView footer. In this post i will try to explain in an easy way that how we can display running total & Grand total in a GridView footer combindly. To explain this solution using an example here i use a sales order report. The report contains all sales order amount in a tabular way. I will use a GridView to display sales order amount and use GridView footer to display Running total & Grand total. Let we have a customer table with id and name column plus an orders table with OrderID,CustomerID,OrderDate & Amount. Now our goal is to show all customers order with amount as well as page wise running total & grand total. Note that running total is necessary when you enable paging in a GridView where as Grand total is always you can consider.

validateRequest appears to be kicking in in MVC RC1 despite settings

After upgrading a project to the RC a System.Web.HttpRequestValidationException is thrown when posting a value containing HTML from a TextArea. I have checked that validateRequest=false in Views/web.config, and have set this in the application's root web.config. I have also created a fresh MVC project, created a simple view & controller and posted a simple html paragraph element with the same result. Call stack provided. [HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (html="

hello world

").] System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) +8718538 System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName) +111 System.Web.HttpRequest.get_Form() +129 System.Web.HttpRequestWrapper.get_Form() +11 System.Web.Mvc.ValueProviderDictionary.PopulateDictionary() +113 System.Web.Mvc.ValueProviderDictionary..ctor(ControllerContext controllerContext) +74 System.Web.Mvc.ControllerBase.get_ValueProvider() +31 System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) +53 System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +109 System.W

Client script not running


Dear all,

in my MVC 2 application, and in the shared Master Page I wrote this little script for menu handling :

<script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/javascript"> $(document).ready(function () {   
     $('#nav li').hover(  
         function () {  
             //show its submenu  
             $('ul', this).slideDown(100);  
        function () {  
           //hide its submenu  
            $('ul', this).slideUp(100);           

The script, that shows menu items when the

Very Basic Question - Error message running first page


Hi Everyone,

I am running Windows 7 and I have gone into Control Panel and activated all of the IIS Functions.

The web application I am running was downloaded from the net (and has worked on other machines previously).  Once I downloaded it, I moved it into C:/inetpub/wwwroot/code/main.asp

I am a bit of a novice at this!  But I am hoping someone can point me in the right direction!


I get the following error when I try and run the web application through IE:

"An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click here to find out more about this error."

(When i click the "click here" button it just goes to the IIS site).


Appreciate any help I can get!




ASP.NET Workflow: Web Apps That Support Long-Running Operations


Integrating workflow into ASP.NET applications means communicating with activities via a workflow queue and hosting the runtime in the global application class. We'll show you how.

Michael Kennedy

MSDN Magazine January 2009

Parallel LINQ: Running Queries On Multi-Core Processors


Use Parallel Language Integrated Query (PLINQ) to take advantage of multi-processor computers and the newer wave of multi-core processors.

Joe Duffy and Ed Essey

MSDN Magazine October 2007

Wicked Code: Running ASMX Web Services on STA Threads


Jeff Prosise describes performance problems in an ASMX Web service that relied on legacy COM and Visual Basic 6.0 to perform key processing tasks and the approach he took to find a fix.

Jeff Prosise

MSDN Magazine October 2006

High Availability: Keep Your Code Running with the Reliability Features of the .NET Framework


Reliability requires the capacity to execute a sequence of operations in a deterministic way, even under exceptional conditions. This allows you to ensure that resources are not leaked and that you can maintain state consistency without relying on application domain unloading (or worse, process restarts) to fix any corrupted state. Unfortunately, in the.NET Framework, not all exceptions are deterministic and synchronous, which makes it difficult to write code that is always deterministic in its ability to execute a predetermined sequence of operations. In this article Stephen Toub will show you why, and explore features of the .NET Framework 2.0 that help you to mitigate these situations and write more reliable code.

Stephen Toub

MSDN Magazine October 2005

.NET Internals: Examine Running Processes Using Both Managed and Unmanaged Code


There are plenty of times when you need to get information on running processes, not the least of which is during performance tuning. Using the techniques in this article and special .NET classes you'll see how to get a process' ID, name, priority, number of threads, kernel handle, and memory consumption, as well as its user-mode, kernel-mode, and total elapsed running time and put them to use in a custom app called AssemblyBrowser.

Christophe Nasarre

MSDN Magazine October 2004

Code Name Indigo: A Guide to Developing and Running Connected Systems with Indigo


This article describes a collection of new programming frameworks that are part of "Longhorn," the upcoming version of Windows. "Indigo," the code name for this framework, provides rich support for service-oriented design that is complementary to traditional object-oriented approaches. Indigo marries the best features of .NET Remoting, ASMX, and .NET Enterprise Services into a unified programming and administration model. Indigo's deep support for standard protocols, including HTTP, XML, and SOAP, makes it easier to integrate applications and services without sacrificing security or reliability.

Don Box

MSDN Magazine January 2004

Develop a Web Service: Up and Running with the SOAP Toolkit for Visual Studio


The new Simple Object Access Protocol (SOAP) Toolkit for Visual Studio 6.0 provides the infrastructure for developers to build, expose, and consume Web services. With a few exceptions that are outlined in the toolkit, the SOAP Toolkit complies with the SOAP version 1.1 specification. It includes the Remote Object Proxy Engine (ROPE), a Service Description and Code Generation Wizard, and code that provides ASP and ISAPI reference implementations of SOAP listeners. This article describes the tools and the object model of the SOAP Toolkit, and then demonstrates ASP and ISAPI implementations of a functional Web service using this toolkit.

Rob Caron

MSDN Magazine August 2000

Is your code running in a SharePoint Sandbox?


You could execute a function call that is not allowed in the sandbox (for example call a static method on SPSecurity) and catch the exception. A better approach is to test the friendly name of you app domain:

AppDomain.CurrentDomain.FriendlyName returns "Sandboxed Code Execution Partially Trusted Asp.net AppDomain"

Because you can never be sure that this string changes in the future, a safer approach will be:


See http://www.sharepointoverflow.com/questions/2051/how-to-check-if-code-is-running-as-sandboxed-solution for a discussion on this topic.

Problems when Running


Every time I try to run I get the following Error.  Error 1 Object reference not set to an instance of an object.  

I can then run again and it works.  Any Ideals?



How to get the current directory of msi is running from?



I Created a setup file with Custom Actions.

How can i get the Current directory of msi file is running?

for ex:-

I copied my installer on Desktop and installing.. in this case my current directory would be desktop location

Any Help would be Greatly Appritiated!!

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