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

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

Is there any way to run ad-hoc sql queries from within SQL CLR debug mode?

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :

I'm picturing a Management Studio query window type of interface, but inside of Visual Studio.  I'm pretty sure it doesn't exist, but want to ask to confirm before putting in a feature request.  The reason it's needed is that when working with triggers in SQL CLR, the Inserted and Deleted tables are essential to the functionality, but cannot be accessed from Management Studio.  That makes debugging really tough when a query does not yield the expected results, because similar queries can't be easily plugged in and executed.

Also (a related comment / question / request), is it contemplated to make the SQL CLR functionality more fault tolerant?  Once ANY exception is thrown, NO further queries can be executed.  That also makes it really difficult to debug when a query isn't working right, as it requires countless re-executions of the code to diagnose the issue.


View Complete Post

More Related Resource Links

How to run Scripts in Debug mode to run queries step by step in Sql Server 2008


Hi all

i am working on SQL Server 2008 i dont know to how to use the debuging mode to Run Scripts

so that to check Scripts step by Step  please help me out i am wasting my time for checking the error please provide me any link that provides article & Demonstration

thanks in Advance

Sunil Yoganna

How to figure out if package runs in debug mode

Hi, I would like to know whether there is a possiblity to dynamically determine at runtime if a script is runing in debug mode or is being executed via SQL Server Agent? My goal is to prompt the user with some information e.g. initial catalog ensuring the package is being ran in the correct environment (development/production). However, as SQL Server Agent does not support MessageBoxes I would like to write some alternative code in this case. Thanks in advance!

DTExec is MUCH slower that just running my package in Debug mode in BIDS 2005

I am using BIDS / SSIS 2005.  I have a large package that runs very smoothly and fairly quickly when run in debug-mode through BIDS.  When I actually deploy the package to SSIS and execute it using either DTExec or DTExecUI it is WAAAAYYY slower than when run from the development environment.  So slow that I become convinced it is hanging on steps that execute very very quickly in BIDS.  I have read this thread -> http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/5585fa13-dd15-4406-9d4a-e993f2af5929 which has not helped. I understand that DTExec would be faster than DTExecUI because the former does not have to deal with the GUI component but I would have expected both (and especially DTExec) to be faster than running in debug from BIDS. I realize I am not providing a ton of detail here, problem is I just don't know where to start... any advice on what I should be looking at to improve package execution through DTExec and / or DTExecUI would be greatly appreciated.  Why would DTExec be so much slower than BIDS Debug??? Thanks in advance.. - Charles

Hit counter not updating except in debug mode

I have a webcast site that lists them in a gridview. Users have two options, either play the video directly or go to a details page on it and play from there.  When the user plays the video directly I need to update the count of how many times it has been viewed.  When I run the page from my local machine in debug mode it correctly updates the counter.  When I run the page regularly, both from my local machine and on the server it does not update the count, but it does open and play the video.  It doesn't give any error messages in any method of running.  The only difference between running it on my local machine vs production server is that I have to comment out the authentication code on my local machine.  The authentication programming was created by someone else with far more knowledge and I only barely understand how it works.  For that matter this site was originally created by that same person.  He included the hit counter on the details page but forgot to add it on the front gridview page, so I'm modifying it based on his code on the second page. Important parts of code behind and part of the gridview listed below.  Yes I know the means of creating the first connection string is bizarre.  I think it has something to do with the authenticate files that makes it work.  In the past it has always worked fo

_CrtIsValidHeapPointer(pUserData) getting thrown in debug mode, /clr Forms project calling custom na

I'm working on a native DirectX11 project where I'm trying to use Windows Forms as a GUI for myself to modify things in the visual environment. I know the native static libraries are stable and not walking through memory since I have an .exe that can run it externally from the clr Form project. _CrtIsValidHeapPointer(pUserData) is getting thrown at runtime and I can see that this has alot to do with atexit and _onexit being called. The stack trace that directly relates to my code looks like the following: > HogsheadEd.exe!`dynamic initializer for 'Hogshead::Core::ResourceLibrary::_prototypes''()  Line 7 + 0x32 bytes C++ This line in code is a static member in a cpp: Vector<IResource*> ResourceLibrary::_prototypes; where Vector<type> is a static instance of custom templated class in one of my native static libraries, IResouce is a pure virtual class, and ResourceLibrary is essentially a singleton with all static members and methods. I've done alot of searching and http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/62db4002-4ebc-4a3a-91ec-9fc702db821e/ appears to be very similar to my problem yet anything I try mentioned there does not work for me. I am using Visual Studio 2010 and to be honest I do not know much about debug symbols. This seems to be a solved problem from what I'm

Visual Studio 2005 won't enter debug mode.



I am developing asp.net 2.0 using c# and when I place a break point on a line of code and hit f5 or "start debugging" it just brings up the website without stopping at the breakpoint.

 It is set for debug not release and I don't know what else to do? Does anyone have any suggestions?



How to set different references in debug and release mode

I have a C# application end a C# assembly. I can compile both in release and debug version. In the C# application I'd like to refer the release assembly version in release mode and the debug version for the debug.
Is it possible? In VS 2005 you have just one list of references for both release and debug.

Turn ON Custom Error and disable debug mode



We have a ASP .Net based web service setup and hosted on a IIS v6.0. We wish to turn on custom error and disable debug mode. I understand these can be accomplished by modifying the web.config and machine.config file. However, since web service does not have a UI...please let me know if the changes made to the config files will take into effect. The reason why we wish to do these changes is because, our external auditors have flagged these as a vulnerabiity.



Venkatesh Selvaraju

References in debug vs release mode



I am developing a web site in Visual Studio 2008. I have a project for the web application and several class libraries as references. When I add the references I select the file under bin/debug in the class library folder. When changing the project to release mode the references still point to the .dll in the debug folder. Shouldn't this change automatically. How should I add the references so that debug and release are properly referenced?

Best regards, Janhe

Which tier do Linq queries belong?


Started in middle of a new project.  Our design architecture uses an n-tier (not MVC - no controllers) structure with Presentation, Data, Business and Service tiers.  However the lead analyst has the majoriety of code all in the Business tier claiming it all contains Business logic.  Our data tier is nothing more than a single .dbml model of the primary database to support all of the Linq queries in the Business tier.  To my mind Linq queries and classes they use are data access and belong in the data tier  but our lead analyst says they contain business logic therefore have to be in business layer.  

Debug implementation of URLrewriter.net



After some googling and help from the forum, I have integrated the the URLrewrting.net in my project. There are no error when I build the project, but the URL rewriting does not work. I am able to figure ot where the problem is. Is there a way to debug this. The code is as below:

 Web.config file

<?xml version="1.0"?>
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.W

Combining two LDAP queries


Hey guys, I have these two queries I'd like to combine into one.  Is there any way of doing it?
Query 1: (&(!cn=SystemMailbox{*})(&(&(ou>="")(name=executive*)(objectCategory=organizationalUnit)(ou=*operations))))
Query 2: (&(!cn=SystemMailbox{*})(&(ou>="")(name=50*)))
Thanks in advance.

Hey guys, I have these two queries I'd like to combine into one.  Is there any way of doing it?


Automatic Batch Printing in ReportViewer Remote Mode


Please help me, i have a properly working codes that is capable of the following:

1. Printing of Reports from ReportViewer without using the build-in print ICON in the actual ReportViewer. to view the working for the printing alone please click here.

2. Batch Printing by making a loop and placing a checkbox on the gridview where the needed paramerter (DataKeyNames ID) is retrieved then pass to the ReportViewer

This is my Code

foreach (GridViewRow row in GridView1.Rows)
            CheckBox chk = (CheckBox)row.FindControl("CheckBox2");
            if (chk.Checked)
                ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://TestServer/ReportServer");
                ReportViewer1.ServerReport.ReportPath = @"/Tavern/StudPaymentReport";
                ReportViewer1.ProcessingMode = ProcessingMode.Remote;
                ReportParameter[] rptParams = new ReportParameter[1];

                rptParams[0] = new ReportParameter("ClientID", GridView1.DataKeys[row.RowIndex].Value.ToString());


Data Points: LINQ Projection Queries and Alternatives in WCF Services


LINQ's ability to project randomly shaped data into anonymous types can be a blessing and a source of frustration, says Julie Lerman. It's great when you just need to grab a special view of your data, but it can be problematic in certain circumstances. She explains what the limitations are and how to get around them.

Julie Lerman

MSDN Magazine May 2010

Data Points: Precompiling LINQ Queries


Did you know that by precompiling LINQ queries you might actually be degrading your app's performance if you're not careful? Julie Lerman explains how to ensure you're not re-precompiling queries each time and losing the expected performance benefits across post-backs, short-lived service operations and other code where critical instances are going out of scope.

Julie Lerman

MSDN Magazine March 2010

Toolbox: Easy LINQ Queries, Becoming A Better Developer, And Logging Help


This month Toolbox provides help with error logging, finds an app that helps you write LINQ queries, and explores the non-technical side of development.

Scott Mitchell

MSDN Magazine September 2008

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

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