.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

Count the number of times a SP ran in the past?

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

I am trying to see how many times a set of 50 sp's ran on my prod server. The idea is to remove the ones not being used anymore and clean the unused sps. My environment is Sql Server 2005 sp3

I did a basic search online and found out that sys.dm_exec_query_stats does a good job in giving the cout but only if the cache has not been flushed out. How do i know when was the last time the cache was flushed out in my sql server? Also what do they mean by cache being flushed out?

Is there a better way to capture all my sp execution counts on SQL Server 2005 other than running a server side trace?

View Complete Post

More Related Resource Links

Count of number of times the document is downloaded from document library

Hi All, I am working on sharepoint 2007.  My requirement is: I need to take the count of number of times the document is downloaded from document library. I used log report which doesn't solved my purpose. Any Idea how can we acheive this ?   Regards

Cannot count number of checked items using jQuery

Hello,Using Microsoft built-in jquery files, when counting numbers of checked checkbox, the jquery-1.4.2.min.js cannot count the correct result ,however, the version jquery-1.3.2.min.js gives out the correct one, why?            $("#check").click(function () {                var nameSports = new Array();                var i = 0;                $('input[name=selector]:checked').each(function () {                    nameSports[i] = jQuery(this).val();                    i += 1;                });                if (loopCounter != 0) {                    alert(i);                }  

How to count number of characters in a textbox?

On my current form I have it validating a Canadian Postal Address (xxx xxx). The space is optional but if the user does not use a space, then once the validation passes it will insert one. How can I count the first 3 characters of the textbox, insert a space, then add the rest of the characters?Thank you

count number of files after uploading


Hello, im hope i can make sense to this post cause i dont have an idea where to begin :-) I have some files upload code so the user can upload files to the server (it can be 1 or 5 or 20 files). the code is working fine, and the files uploading to the folder on the server. The problem is, that after the files uploads i need to display to the user some textboxes to every file (like: number of copies, if its color or b/w, the print size etc). is there some way, after the files is uploaded, to show the user the name of the files and for each file name to display some textboxes (like: to count the number of files and then display the names and few same textboxes for each file), thanks

Count the number of users per web page


Hello everyone,

I have a website that has 10 aspx pages in it, and I'm trying to count how many users are on any one page at a time, and display that number on the web page.  I have set it up to use an Application object ("TotalViewers"), and initialize it to 0 in the Application_Start event handler of the global.asax file.  My reasoning (probably way off base) is to increment the count on each page load, and then decrement the count on each page unload.  The increment part works ok, but when I add the code in the page unload event handler to decrement, it seems that Unload happens before the Page is presented to the client, so the  value always stays the same (adds one in page load, subtracts one in page unload).

How else  can I track number of users on each page?  (simply, becuase I am still a beginner).  I have already done some google searching and haven't come up with anything useful. 

All my pages are being navigated via a TreeView control.

Thank you,





Count gives me the same answer regardless of the number of rows


I always get a result of zero from the following code sequence even as the row count changes and I just do not see what the error in my syntax is.




supercount As Integer

supercount = 0


Dim sqlkit As String

sqlkit =

Count the number of months since start date Options

I have a Measure.TransactionValue and also a Date.Month Dim and a 
Subscriber Dim 

I want to do a Count of months since first transaction date by 

Subscriber | Month | Measure.TransactionValue | 
1 | 201002 | 0 | 0 
1 | 201003 | 100 | 1 
1 | 201004 | 200 | 2 
1 | 201005 | 300 | 3 
1 | 201006 | 0 | 4 
1 | 201007 | 50 5

Make sense?

Any help would be greatly appreciated. 

count number of columns in group



I need to count number of columns in group -

I have a matrix with SUM in the date area.

I have a group column (lats say 'city') and under it my columns (lats say 'street name');

Under each 'street name' I have cell with SUM function.

The problem is:

When The main group (city) is not expand I get the sum of all cities and what I want to get is an average .

So what I thought of was to divide that number in the number of streets under each city group.

How can I get that number?


How to count number of viewer of a thread in sharepoint discussion board.


HI All,

I am working on sharepoint discussion board, I want to calculate the total number of viewers of a thread.

Just like a thread in MSDN forum Replies & Views.

is there any column in sharepoint discussion board to get number of views.

please tell me the approach or share the C# code.



A large 76mb xml file best way to count the number of nodes before processing




For the general processing I am using a XMLReader due to the size of the file and technically only need a once time read per file.

But the external company who made this starts it by doing a count of the nodes to say how many inserts/updates are to be done this is done by basically looping through the xml file counting them and then they recreate the xmlreader again to finally process it.

It just seems a bit clumsy to me, understandably the size of the file means we can't just load it into memory but is there another low cost method to count the nodes without having to recreate the xmlreader each time.


Could we stream the file instead and use XMLDocument or Xdocument (giving us linq capabilities) to improve the efficience as I imagine there must be some sort of performance hit re-creating a XMLReader 2 to 3 times.



For example would this use more memory than say xmlreading and looping the whole thing through to get a count.

using (XmlReader reader = XmlReader.Create(filename, settings))
                    XPathNavigator nav = new XPathDocument(reader).CreateNavigator();
                    XPathNodeIterator xPathIt = nav.Select("//root/theNode");
                    int c = xPathIt.Count;

Count the number of posts in a blog


We have a new blog site which contains the standard list called Posts.  We would like to display a webpart on our main blog page that returns a count of how many posts are in the Posts list.  Does anyone know if there is a block of code that I could put into a content editor webpart on my page to return this count? 

I found a post where someone said you could create a Data View using SPD and edit some code to return a count, but this didn't work for me.

Disable past date, showing URL in gridview and validate generated number



I've got 3 problems and I can't find the solution so that's why I'm here.
1. I've got a calander for adding a product to my shop. How can I make sure that you can't select a date in the past?
2. I have a gridview, and I have added a hyperlinkfield in access. When I'm filling up my gridview it doesn't show a link, it shows this:
example= www.Groezrock.be#http://www.Groezrock.be#
3. I've added a label and a textbox on my guestbook page. It says "Please fill in the number in the textbox -label that generates 4 random number- txtbox.
For filling up the textbox I use this code:

        Dim randObj As New Random
        lblVraag.Text = (randObj.Next(1001, 10000).ToString)

The problem is, when I fill in the number, it always gives me the validation error "Numbers don't match" which I added myself.

        If txtnumbers.Text = lblnumbers.Text Then
            lblFout.Text = "Numbers don't match."

End If

How to count number of bytes in string for utf-8 encoding


How to find number of bytes in string in utf-8 encoding ?

str.Length returns number of characters but in utf-8 encoding some characters occupy more than 1 byte ? 

Unit Testing SharePoint - Past, Present, and Sporm

As I described in SharePoint: The Wild West of Software Development there is a serious problem when you develop for SharePoint: ensuring quality through unit testing is really, really hard. And that's where a new open source tool just released today called sporm (SharePoint Object Relational Mapper) comes in. While sporm provides many benefits besides simplified unit testing I wanted to focus on this topic first, because sporm's approach, which models the entity framework in the way it supports POCO's, is a unique feature not available with other SharePoint tools like LINQ to SharePoint.

Convert English to Arabic number without changing any regional settings in .net

Well, most applications that I worked with was multilingual that supports English UI and Arabic UI.

And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC.

So the code below will help you to display Arabic number without changing any regional settings.

dynamically adding sql server columns based on number of files in fileuploader


I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.


I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!


Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")


Embeb a variable number of videos


I need to provide some alternate content for my non-Flash users.

I have a directory of video files that is scanned using the DirectoryInfo() function, and I want to use the results to embed all files ending in ".mov" in QuickTime players on a web form.

How would you approach this? Right now I am using the count on the array of videos to determine how many times to repeat the embed code.  But this seems inelegant.

Is there a way to have a single QuickTime player.ascx control that gets duplicated according to the number of videos available for display?

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