Show output window during build in Visual Studio 2010

by Rick Glos23. August 2010 17:07

I was complaining to my co-worker the other day that my output window in Visual Studio 2010 was not showing during a build.  I usually hit Ctrl+Shift+B, and while I appreciate the minimalist UI, I like to see what it’s doing.  All I would see was the status bar text saying, “build started…” followed by, “build succeeded”, or in same cases, “build failed”.


When I was watching my co-worker, the output window popped up showing a log of the progress.  I think this is the default but I don’t recall changing my configuration.  I do normally take the output window and unpin it so it stays out of the way and off my screen while I’m coding.  Perhaps the act of doing this flips the option.  I don’t know.  What I’m after is when compiling, slide the window up from the bottom and show a log of what is compiling.


I poked around and found the option to turn this on or off and here it is for future reference.

Tools –> Options –> Projects and Solutions –> General –> Show Output window when build starts


Tags: ,

Cookie Cutter SSIS, Part 3 – The Audit Database

by Ellen12. August 2010 23:52

I think it's safe to say that most (if not all) data warehousing experts recommend keeping track of ETL execution results in some way. I started working with custom audit tables back in the DTS days, starting with some code I stole from Professional SQL Server 2000 DTS by Chaffin, Knight and Robinson. Over time, I've morphed the audit database into a critical part of the Cookie Cutter SSIS methodology.

Our standard audit database contains the following schemas:

  • audit
  • metadata
  • etl
  • util
  • and the ever-popular dbo, of course

Our standard audit database contains the following tables:

audit.package_executionETL execution information at the package grain. We capture the execution GUID to enable linking to the standard SSIS logging table, dbo.sysdtslog90.
audit.jobETL execution information at the table grain. Cookie Cutter SSIS is about table-centric processing. This table will probably cause most DBAs to run, screaming, from the room (I try to protect Serena, our ace database designer, from it as much as I can). It's set up to be as generic as possible - consequently, a number of the columns in any given row will likely be null if they don't apply to the particular table being processed.
audit.execution_eventThis table stores event-related data. A SQL task with the stored procedure that inserts the event record can be inserted in your package when an event handler fires.
audit.reject_rowsThis table works with the error database - it stores a daily summary of total error rows for every non-empty table in the error database. Originally we developed this for use in client audit dashboards to give a quick view of potential problem data.
audit.control_parameterControl parameters are the mechanism we use to expose changing, low-cardinality data outside of ETL code. We use the parameters to populate variables inside of the SSIS packages. By setting up a control parameter for a potentially changing data item, we avoid hard-coding values inside of SSIS packages (where they're harder to find) and allow our ETL to be data-driven and dynamic.
metadata.dim_roleData mart dimensions may play multiple roles in a given fact. The most notorious role-player is the date dimension (at one client site, the date dimension is used in over a hundred different ways.) This table is a way to keep track of dimension roles; however, it was originally developed to make IBM Cognos Framework Manager easier to update. Rick, our ace developer, wrote a tool to assist Kathy, our ace report designer, in keeping the Framework Manager model up to date with terminology for both technical and business users (the terminology is captured from data mart object extended properties). This table was created to facilitate renaming all the role-playing dimensions inside the Framework Manager model.

I took the Kimball University class from Joy Mundy and Warren Thornethwaite based on their book, The Microsoft Data Warehouse Toolkit, back when the book was just published. One of the concepts they presented was using SQL Server extended properties to store metadata about data mart objects. I took this idea and ran with it, and it has been one of the most transformative concepts in all my data warehousing experience. (Thanks, Joy and Warren!) Extended properties will get their own post - this particular table is used in the process of applying extended properties to data mart objects.

…and the following stored procedures:

audit.pr_insert_audit_jobInstantiate audit job record (job_key as int data type)
audit.pr_insert_audit_job_bigintInstantiate audit job record (when installation requires job_key of type bigint)
audit.pr_insert_execution_eventAdd an event handler record
audit.pr_insert_package_executionInstantiate package execution record (package_exec_key as int data type)
audit.pr_insert_package_execution_bigintInstantiate package execution record (when installation requires package_exec_key of type bigint)
audit.pr_update_audit_jobUpdate audit job record (configured for int type job_key)
audit.pr_update_package_executionUpdate package execution record (configured for int type package_exec_key)
etl.pr_add_table_extended_propertiesAdd extended property metadata to data mart objects (used with SSIS metadata update package)
etl.pr_get_row_countGet row count from a specified table
etl.pr_get_surrogate_keyGet the next surrogate key from a specified table
etl.pr_truncate_tableTruncate a specified table

I’ve attached a script to create the audit database and all of the above schemas, tables and procedures.  The script assumes an int type for the job_key and the package_exec_key, and you’ll need to amend the code for the database create statements to point to the correct path in your environment:

In the next post in this series, I’ll discuss the other standard databases and some utility functions.

Tags: , ,


How to run windows batch files from Visual Studio 2010 Solution Explorer

by Rick Glos11. August 2010 20:37

This is an update to running cmd files from Visual Studio 2005 and Visual Studio 2008 post I did a couple year ago.  You can use this technique to run windows command files with the .bat and .cmd extensions.

Just as previously, we need to create at least one, and optionally two, external tools.

One that terminates the window after executing.

Here’s the values for you to copy+paste and screenshot.

Field Value
Title Run With Cmd
Command %ComSpec%
Arguments /C $(ItemPath)
Initial Directory $(ItemDir)


One that leaves the command window open after executing.  Useful if you didn’t put a ‘pause’ in your command file or if you want to leave the cmd window open for additional commands.

Field Value
Title Run With Cmd and Remain
Command %ComSpec%
Arguments /K $(ItemPath)
Initial Directory $(ItemDir)


Now we should see our new external tools available on the Tools menu.


However, we’d like to right-click on the file and run the cmd file via Solution Explorer like so:


Customizing this context menu in Visual Studio 2010 is abit different from context menu customization in VS2005/2008.

Click Tools –> Customize… to launch the Customize Dialog.

From that dialog we want to select the ‘Context menu’ radio option and the ‘Project and Solution Context Menus | Item’ from the drop down.  I’m going to put the two commands right under ‘Open With…’.  You can certainly do whatever you wish.  Start this process by clicking ‘Add Command’ button on the same dialog.

So here’s a screenshot with that above paragraph in a picture instead of words:


When we click ‘Add Command’, the Add Command Dialog will open.  Select ‘Tools’ from the Catgories list box on the left and find your external command from the command list box on the right.  Your command will be named something like ‘External Command {Number}’ where {Number} is the number in your list from your External Tools dialog.


Clear as mud?  I’m going to use this to make sure I add External Command 3 and External Command 4 to the context menu.


Now the ‘Project and Solution Context Menus | Item’ context menu should look like this in the Customize Dialog.


Close that dialog and check out your new menu items by right clicking on a file in Solution explorer.  You should see your new external commands.


For extra credit, you can go back into the Cusomize dialog and move your commands around into spot your like and alos create a Group around them.


The finished product looks like this.


Tags: ,

Configuring Windows Server 2003 with ASP.NET 4.0 while supporting ASP.NET 2.0

by Rick Glos11. August 2010 01:29

Went through some interesting configurations today and wanted to document it.

Our client has a server, Windows Server 2003 SP2, in which we already have many ASP.NET 2.0 applications running, including some serving up Silverlight 3.0.  We needed to migrate one of our applications to ASP.NET 4.0 and Silverlight 4.  It was a little more involved than I would’ve thought.

Here’s the steps:

Install the .NET 4.0 Framework on the server.

This did not require a server reboot.  I have yet to have a reboot required when installing a .NET Framework version.  Perhaps I’ve been lucky so far.  This is important because you don’t want to disrupt folks using the resources on the box.

Create a separate App Pool for the web applications that are going to run under .NET 4.0.

From what I understand, you can’t have different web applications running under the same application pool.  Since this box has production and beta applications on it already, we need to create an app pool.  Nothing fancy.

Create the new virtual directory for the new application and assign it your new app pool

Nothing fancy here.  Use the properties dialog to create the application and assign the app pool.


Install the scriptmaps for ASP.NET 4.0 to the new web application.

If you don’t do this step and you try to run the application under 2.0 you will get error:

Unrecognized attribute 'targetFramework'

This is because the web.config is different now and contains a new attribute on the compilation element.


If you try and set the ASP.NET version using the properties panel, you will get a warning that you are going to cause a restart of the entire W3SVC service therebye killing all the work anyone may be in the middle of using existing applications.


Since we don’t want to disrupt currently running applications, we need to do this through the command line.

Open a cmd prompt and navigate to the v4 Framework directory: %WINDIR%\Microsoft.NET\Framework\v4.0.30319.  Once there, we can use the administration utility to change the application.

   1: aspnet_regiis.exe -s W3SVC/1/ROOT/SampleApp1

Here’s an example of the output when doing this against a test application.


Enable ASP.NET v4.0.30319 web service extension

If you try to hit the web application prior to this step you will receive ‘The page cannot be found’.


Enable the new version ASP.NET by using the Web Service Extensions node in IIS 6 and switching ASP.NET v4.0.30319 from Prohibited to Allowed.



From here you should be done and can now use your application right alongside older ones on the same web server.

Tags: ,