Tuesday, November 30, 2010

An error occurred while extracting the result into a variable of type (DBTYPE_I4)

This is an obvious error related to output parameter when using "Execute SQL Task" Control Flow item.

Change the parameter mappings from LONG to VARCHAR to fix this error.

How to get ErrorDescription in SSIS

If you use an Error Output in SSIS you will get the ErrorColumn and ErrorCode and not the Error Description. You can get the ErrorDescription by using a script component.

Make sure you a column to the Output that is going to contain the Error Description and use the following code.

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Row.ErrorDescription = ComponentMetaData.GetErrorDescription(Row.ErrorCode)
End Sub


public override void Input0_ProcessInputRow(Input0Buffer Row)
Row.ErrorDescription = ComponentMetaData.GetErrorDescription(Row.ErrorCode);

Saturday, November 13, 2010

Screen Capture on MAC

Use the Command-Shift-3 shortcut for taking a screen capture of your entire screen

Use the Command-Shift-4, which gives a crosshair cursor so you can choose which area of the screen you want to capture.

Use the Control-Command-Shift-3 (or 4), which, instead of creating a file on the desktop, copies the capture into the Clipboard memory,

How can I launch multiple instances of MonoDevelop on the Mac?

On Mac, if you have an app open and you try to launch it again, the Mac just switches to the open app. You can force it to open a new instance by passing the option "-n" to the launcher. In a terminal, run

open -n /Applications/MonoDevelop.app

Note: MonoDevelop is capable of opening multiple solutions. To do this, simply uncheck the "close current dialog" checkbox in the "Open" dialog, or hold down the control key when clicking on one of the recently opened projects in the Welcome Page.

Friday, November 12, 2010

Delete a variable in SSIS Package

To delete a variable from a package

1.In Business Intelligence Development Studio, open the Integration Services project that contains the package you want.

2.In Solution Explorer, right-click the package to open it.

3.On the SSIS menu, click Variables. You can optionally display the Variables window by mapping the View.Variables command to a key combination of your choosing on the Keyboard page of the Options dialog box.

4.In the Variables window, click Show User Variables.

5.Select the variable to delete, and then click Delete Variable.

6.If the Confirm Deletion of Variables dialog box opens, click Yes to confirm.

7.To save the updated package, click Save Selected Items on the File menu.

Wednesday, November 10, 2010

How to raise Error event in SSIS?


ComponentMetaData.FireInformation(int InformationCode,
string SubComponent,
string Description,
string HelpFile,
int HelpContext,
out bool pbFireAgain

Raises a user-defined custom event in the package.

Informs the package of an error condition.

Provides information to the user.

Informs the package of the progress of the component.

Informs the package that the component is in a state that warrants user notification, but is not an error condition.


bool pbFireAgain = false;

ComponentMetaData.FireInformation(0, string.Empty, "Information", string.Empty, 0, ref pbFireAgain)

Check for file existence in SSIS

How do you check to see if a file does not exist in SQL Server Integration Services (SSIS)?

Use script component and add the following script.

If System.IO.File.Exists("\\Server\Share\Folder\File.Ext") Then
Dts.TaskResult = Dts.Results.Success
Dts.TaskResult = Dts.Results.Failure
End If

The File System Task in SSIS can be used to move, copy, delete files and folders but does not support file existence checks.