Showing posts with label cast. Show all posts
Showing posts with label cast. Show all posts

Sunday, February 19, 2012

Error importing SSIS packages on SQL Management Studio

I encounter this error when importing SSIS packages using SQL Server Management Studio:

===================================

Unable to cast object of type 'Microsoft.SqlServer.Dts.ObjectExplorerUI.ImportPackageAsAction' to type 'Microsoft.SqlServer.Dts.ObjectExplorerUI.ISimpleAction'. (Microsoft.SqlServer.DtsObjectExplorerUI)


Program Location:

at Microsoft.SqlServer.Dts.ObjectExplorerUI.DtsServerMenuItem.Invoke(INodeInformation parent, String mode, String assembly, String type)

The Integration Services that I'm using has just been rebuilt due to problems after installing SP2. I'm using Integration Services 9.0.3042. I can't find anything having this same problem. Any help will be appreciated.

Thanks!

Hi ya,

Try these posts. If that doesn't help then best bet is to report it to MS.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=335181&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=406974&SiteID=1

Cheers

Rizwan

Wednesday, February 15, 2012

Error handling when one field value is bad

Here's an example of what I'm playing with:

update TestTable

set IntValue = Cast(StringValue, as int)

flag =

BEGIN TRY

0

END TRY

BEGIN CATCH

1

END CATCH

I'm trying to take a string value holding an integer and populate an integer field with that value. But, every so often, the string value does not contain an integer (e.g. '13.9" or "CA"). That error would cause the entire column UPDATE to be rolled back. i'm trying to get around it with some kind of "TRY CATCH" construct but I don't believe it can work.

What would you suggest?

Barkingdog

No, you are right this won′t work. For me, the best Exception handling is to prevent exceptions, in your case check the value for being numeric, there is a function ISNUMERIC which can do that for you. But be careful with that function, because it checks for currency numeric only, so the value "$" which is part of a currency expression will also evaluate to true.

See more details on the site: http://www.aspfaq.com/show.asp?id=2390

HTH, jens Suessmeyer.

http://www.sqlserver2005.de