.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

How to figure out if package runs in debug mode

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :Sql Server
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!

View Complete Post

More Related Resource Links

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

XML Source (Data is not loading to Destination ,Package Runs sucessful)

Hi First I run execute SQL Task SELECT TOP(10) [Message],opportunity_Id  FROM SBP FOR XML PATH ('GS_Opportunity'), ROOT('GSOpportunities') That will make 10 different file into single file then i have assigned this output to variable and it will output as XML Now I put Data flow task ,in it I put XML task and in source i have put XML Data From Variable and I select XSD file location,now XML task is showing me different source table and i have selected appropriate destination table but when i run this package it will not transform data from source to destination,Can you suggest me what is the problem i try to put data viewer it is not transforming any data  while insted of if i select direct file location instead of variable it is running good    

Can not figure out LDAP naming convention for AD Application Mode login

I am trying to configure Oracle Access Manager (OAM) with AD application mode (ADAM). I am being prompted for the administrator (root DN) LDAP login for the ADAM instance, and nothing I try works. I know the administrator account in ADAM, and when I installed ADAM I used this info for the partition information, CN=accessmanager, DC=devnet, DC=local , the local admin account is devadmin, which is in the administrators container. My question is, what should the LDAP naming convention I should use for devadmin ? Oracle's example is (cn=administrator,o=company,c=us), but nothing I tried seems to allow OAM to access the ADAM installation. The obvious CN=devadmin,DC=devnet,DC=local does not work. Thanks in advance, John  

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

SSIS 2008 - Excel Source using SQL Connection cancels as soon as package runs.

Let me preface this by saying I'm brand-new to SSIS development. I'm using 64-bit SSIS 2008 and I'm trying to read an Excel spreadsheet using OLE DB. I've already run into and corrected the Run64BitRuntime problem.  Now when I invoke the Package it cancels immediately with the following output: SSIS package "Lesson1X.dtsx" starting. Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning. SSIS package "Lesson1X.dtsx" finished: Canceled. The program '[5400] Lesson1X.dtsx: DTS' has exited with code 0 (0x0). When I edit the Excel Source component itself there are no errors and I am able to Preview the results successfully.  If I use Table or View to access the file, the package runs successfully. Any suggestions will be greatly appreciated. Thanks

ETL package runs locally but fails on server



I am working on an ETL package which reads the data from text file, validates the data and puts it in relevant tables of the DB.

It was working fine until recently I had to make some changes in it. When run the package on local environment, everything worked fine.

When I uploaded the package on server and started testing it, it gave me error. I am passing information like ConnectionString, filepath through user variables. The package is executed by a windows service on server which passes these parameters to the package.

I double checked to see if the values in config file of the windows service are correct but unable to find what is wrong.

Can any one please give me a hint on this? 

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

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

How to debug a failed SSIS package


I created a mall SSIS package that takes data from text files and loads it into a data warehouse.  I can run the package in Visual Studio and it runs fine.  I build the solution and installed it on the server that runs SQL Server (SQL Server 2005, Windows 2008V2 64bit).  I installed it as a SQL Server deployment package using windows authentication.  I then set up a SQL Agent job to execute the package.  The package fails. Event Viewer on the server is very helpful.  It tells me: "Package "DatamartLoad" failed."

There is nothing in the SQL Server Agent Error Logs.

Any suggestions on how to debug this???


SSIS package runs very slow on SQL 2008 R2 server, runs very quickly on virtual XP machine


Hi All,

I've been troubleshooting this issue on and off for a few weeks now.  I've scoured these forums and looked through sqlis.com, but I'm just about out of ideas.  Here's what's happening.

I have a *very* simple integration services package I developed on a  virtual Windows XP machine running on my workstation.  The package uses a script task to simulate a one-row source with four columns (int, char(64), varchar(512) and char(2)) and then passes that off to a fuzzy lookup.  The fuzzy lookup is running against a table of only about 6,000 rows.  The package then inserts the results into a table and exits.

When I run this from my virtual XP machine, it completes in 1-2 seconds.

When I execute this on the server (either as a job or through DTExec) it takes 14-18 seconds.  The server stores the package in MSDB and is also the location where the fuzzy lookup happens.

I've tried using the 32-bit runtime, creating 32- and 64-bit aliases to the server, changing the name of the server from the name to the IP address and port, stopping/restarting SQL Agent and SSIS Services... none of this seems to change the execution time.

The one thing I've found is that if I enable package logging on the logging tab of the job, using the SSIS Log Provider for SQL Server and pointing it to the same connection st

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


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.


Problems posting to a package


Hey Y'all

I'm currently creating a program that accesses a mysql package to add data to a few tables.  I'm currently getting an error that says  "

ORA-01403: no data found
ORA-06512: at "JESSE.PKG_WORKPLAN", line 42
ORA-06512: at "JESSE.PKG_WORKPLAN", line 177
ORA-06512: at line 1


These lines are


and 177:add_team_members(V_PROJECT_ID, V_START_DATE, v_FISC_YEAR, V_MEMBERS ,V_NUM_MEMBERS,'add');

Checking these variables in my asp.net page they are all receiving parameters.

Is there a  way to see what the database is actually receiving from the asp.net page?

Or is there another thing to be looking at?


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
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