.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

Scripts Help

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

Please help me with a script that can be used to find how long queries have been running. I would like to keep a tab on all queries and how long they have been running so that a historical execution time can be maintained.

View Complete Post

More Related Resource Links

scripts file not found on server - 404


Fiddler is showing a 404 error when my published web application runs. the jquery.js file in
/scripts is highlighted in red by fiddler as not found. ( IIS log also shows the 404 error ).
I run the web app from visual studio, on local host - no problems. The publish is successful.
All the files are in the scripts folder of the web app on the server.

In the site.master I have:
<script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>

Visual studio does not complain about this. ( which indicates the file is found. )

Oddly, when I fully qualify the path, VS says file not found, but after I publish and run, fiddler
shows the jquery file being found and sent to the browser.
<script src="/MvcApplication1/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>

when the <script> path is "../../Scripts/jquery-1.4.1.min.js", the fiddler error is
404: /Scripts/jquery-1.4.1.min.js .

when the <script> path is "/MvcApplication1/Scripts/jquery-1.4.1.min.js", fiddler shows the file
being sent to the browser from that /MvcApplication1/Scripts path.

Both the Scripts fol

Scripts not read when in head tag


I just upgraded to VS2010 if that matters.  I'm learning JQuery and noticed that scripts don't work if they're in the head tag.  Also, I need the script tag with type="text/javascript" in the head (with nothing else) in order for the JQuery scripts in the body to work.

Very bizzare, any suggestions?

With a separate script tag in the <body> with my JQuery script, this works

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />
<script type="text/javascript">

This doesn't:

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />

Text Rendering: Build World-Ready Apps Using Complex Scripts In Windows Forms Controls


The System.Windows.Forms.TextRenderer class provides support for complex scripts in Windows Forms controls so you can render text the way you want and support international locales.

Miguel A. Lacouture

MSDN Magazine March 2006

Windows Script Host: New Code-Signing Features Protect Against Malicious Scripts


Downloading scripts from the Web or e-mail leaves users vulnerable to security risks because scripts can't be signed. But now developers can use Windows Script Host (WSH) to hash scripts so users can verify their source and safety. With WSH, scripts can be signed or verified using all the same tools ordinarily used to sign EXE, CAB, DLL, and OCX files. This article discusses public-key cryptosystems, the process of signing and verifying scripts in WSH, and several warnings about attacks that could potentially be made against cryptographically secured scripts and ways in which to avoid them.

Eric Lippert

MSDN Magazine April 2001

Sql Scripts - Delete all Tables, Procedures, Views and Functions


In a shared environment you typically don't have access to delete your database, and recreate it for fresh installs of your product. 

I managed to find these scripts which should help you clean out your database.

Use at your own risk.


Delete All Tables

--Delete All Keys


AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. - Error being thrown while building asp.net si


Everytime I build my site in VS2010 Beta I recieve a few ajax errors before the site loads here they are in order as they pop out on the build; 


throw new Error("AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the AjaxScriptManager in System.Web.Ajax.dll, or use the ToolkitScriptManager in AjaxControlToolkit.dll.");


And then Next this line is throwing an error, I have a watermark ajax field on the page that I created a long while ago;

Sys.registerComponent(Sys.Extended.UI.TextBoxWatermarkBehavior, { name: "watermark", parameters: [{name:"WatermarkText",type:"String"}, {name:"WatermarkCssClass",type:"String"}] });

 And then lastly;

 if (Sys.Extended.UI.TextBoxWrapper.get_Wrapper(this.get_element()).get_IsWatermarked())


Even with these exceptions the page loads fin

Migrate DB + files outside DB into SharePoint using SSIS and scripts


Hello, just wanted to ask a question about SSIS and SharePoint, any input will be greatly appreciated.... did search the forum but could not find anything....

So basically we have a SQL Server DB with the metadata ONLY, WITHOUT the related files(doc/ppt/pdf..etc) which should've been in the DB and they are on a separate web server inside folders. Each row in the DB has a key (column) which matches the related folder's name, so for row with ID #112, there's a folder named ID112 on the web server with the relevant files inside. There could be more than 8+ files for one folder.  

Now, I think it is possible but just wanted to double check, would it be possible to use SSIS and some kind of a script to get the metadata inside the SQL DB AND the related files inside those folders, combine & relate them and upload them into SharePoint as a custom list with file attachments? would they display the attachment normally (like the paperclip icon in a sharepoint list...etc) I wonder if anyone has tried this...

Any guidance, thoughts, suggestions for other solutions, inputs will be great!!! Thank you!!



DB Scripts

Hi All I want to take the DB scripts for my Objects.i want them in a way that lets say i have a table ABC, i want a script which has the name as ABC.Table. Object name followed by the type of the Object. Is thr a way to do it this way??   Thanks  

Generate Insert Scripts - Windows Tool

Some time back, i remember that there is a windows tool that generates the insert scripts for any given table and i forgot the link from which i've downloaded the tool. By any chance does any have the information on how to generate the INSERT Scripts for a table which has some data. My interest is to port the data between the databases, but the databases are in geographically in two diff locations as well as security restrictions are in place. All i have is email access for both the locations. Thus, if i can generate the INSERT Scripts for the tables, i can send the text file. Please throw your ideas on, transferring the table(s) data between databases.Every thing is perfect as long as you share

How to display Sql Scripts in WPF

Hi,    How to display Sql Scripts in WPF. if any one have please send that sample code. Description: i will give Stored Procedure Name in the UI then i want to display that corresponding Procedure in UI. i need to achieve it in WPF. Is it possible to acheive? Sample Output ------------------ set   ANSI_NULLS ON set   QUOTED_IDENTIFIER ON go   ALTER   PROCEDURE [dbo].[ESP_ADD_MILESTONE] /********************************************************************************************/ /* Company Name : Eagle Consulting, Chennai */ /* Procedure Name : ESP_ADD_MILESTONE */ /* Author : Shiva Sankar */ /* Create Date : 28th Jan, 2009 */ /* Description : Add a new Daily Milestone to an user */ /* Tables Accessed : tasks.dbo.task, tasks.dbo.task_event */ /* Change Log : */ /* Version# Author ModifiedDate Reason */ /* 1.0 Shiva Sankar 14-Aug-2009 Added dev_estimation */ /* 1.1 Shiva Sankar 06-Jan-2010 Changed for 3 qa_estimation */ /* 1.2 Shiva Sankar 06-Jan-2010 Changed for estimates,resources */ /********************************************************************************************/ ( @Group nvarchar(255), @Product nvarchar(255), @Priority nvarchar(255), @Entered_by nvarchar(70), @Assigned_to nvarchar(70), @Task_Summary nvarchar (255), @Task_desc nvarchar(4000), @DevEstimation numeric ) AS BEGIN     DECLARE

2 scripts under 1 button

Hi,I have to prevent from double (or more) clicks for submit button. So I do something like that: var DetailsValidationGroupCounter2 = 0; function disableDetailsValidationGroup2() { if (typeof (Page_ClientValidate) == 'function') { if (Page_ClientValidate('DetailsValidationGroup') == true) { return checkDetailsValidationGroup2(); } else { return true; } } else { return checkDetailsValidationGroup2(); } } function checkDetailsValidationGroup2() { if (DetailsValidationGroupCounter2 == 0) { DetailsValidationGroupCounter2++; return true; } else { alert('Please wait...'); return false; } }  This is fine but after user clicks submit button there should also appear two things: - javascript alert ('bla bla bla') - new window which has to display a preview The problem is that this new window is fired in codebehind of button_click event: Session["ctrl"] = ReportHelper.CreateDocumentationAReport(Managers.StateManager.PositionsNewADocumentation.Value, false); ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script language

Deployments via RS.exe scripts are too slow

Hello - I currently use a set of cmd scripts wrapped around RS.exe and vb script for extracting reports from a "base" folder, and deploying the new reports to N number of client folders.  The performance for the report extraction is very fast.  It extracts all of our reports (about 100 reports all total). The extract portion takes about 1 minute.  The delete portion takes less than 1 minute, but the deploy portion takes up to 30 mins per client!  So basically I can only deploy reports to 2 clients/hr which doesn't scale well. I basically use a parent program to generate a vb script to deploy each report.  The following vb script would be saved to a Report-1.rss file, and ran with RS.exe against our Reporting Services server URL.  So the net effect is running RS.exe 100 times with the following script, just didn't report RDLs and paths. From your experience, should running this script 100 times take 30 mins?  The reports are small in total byte-size and not terribly complicated.  I thought something like this would take 10 mins tops to deploy considering how fast our other .net & SQL deployment run. Public Sub Main()     Dim name As String = "A. Report-1"     Dim parent As String = "/Client-1/Product-1/1. Sub-Folder-1"     Dim location As String = "Cli

Get "insufficient product level" message for packages with ActiveX scripts

I also have a similar issue... We have MS SQL Server 2005 installed, along with SSIS.  I am using BIDS on my desktop to create packages, which also run fine as long as they are on BIDS.  However once I deploy the packages to the server, schedule a job or run them directly from the server, I receive the above error on any ActiveX scripts.  I receive "The product level is insufficienit for component" on any script tasks.  Any other suggestions?  I also do not understand the suggestion above on "in process" instead of "out process". 



I have an SSIS package that uses an XMLA scripts in creating and processing partitions. These scripts are dynamically updated with just Partition name and date. 

 But now, it seems the script in the package has additional items compared to the ones I generated from the cube directly.  

(A) <Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> </Process>


(B) <Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2"> </Process>



As you can see above, the script snippet above should look like (A) but when I checked the package after 3 months processing, it turned to (B) with additional enteries shown below:


Allow scripts to run on the local host.


When I Start Debugging a website on the localhost the yellow bar no longer shows up at the top of the web page. How do I get it back?

How to force Ajax Control Toolkit scripts loading from CDN?


I moved my site to asp.net 4.0, and added ajax control toolkit 4.1.40412.0. Also on the page i added ToolkitScriptManager with attribute EnableCdn="true". But my site continues loading toolkit scripts from resources, not from CDN network. How to fix it?

how to reverse engineer with sql scripts

Is it possible to reverse engineer from sql script?
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