Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 687389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:07:19+00:00 2026-05-14T02:07:19+00:00

The question Is it possible to ask SSIS to cast a value and return

  • 0

The question

Is it possible to ask SSIS to cast a value and return NULL in case the cast is not allowed instead of throwing an error ?

My environment

I’m using Visual Studio 2005 and Sql Server 2005 on Windows Server 2003.

The general context

Just in case you’re curious, here is my use case. I have to store data coming from somewhere in a generic table (key/value structure with history) witch contains some sort of value that can be strings, numbers or dates. The structure is something like this :

table Values {
    Id int,
    Date datetime, -- for history
    Key nvarchar(50) not null,
    Value nvarchar(50),
    DateValue datetime,
    NumberValue numeric(19,9)
}  

I want to put the raw value in the Value column and try to put the same value

  • in the DateValue column when i’m able to cast it to Datetime
  • in the NumberValue column when i’m able to cast it to a number

Those two typed columns would make all sort of aggregation and manipulation much easier and faster later.

That’s it, now you know why i’m asking this strange question.

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

Thanks in advance for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:07:19+00:00Added an answer on May 14, 2026 at 2:07 am

    You could also try a Derived Column component and test the value of the potential date/number field or simply cast it and redirect any errors as being the NULL values for these two fields.

    (1) If you just simply cast the field every time with a statement like this in the Derived Column component: (DT_DATE)[MYPOTENTIALDATE] – you can redirect the rows that fail this cast and manipulate the data from there.

    OR

    (2) You can do something like this in the Derived Column component: ISNULL([MYPOTENTIALDATE]) ? ‘2099-01-01’ : (DT_DATE)[MYPOTENTIALDATE]. I generally send through ‘2099-01-01’ when a date is NULL rather than messing with NULL (works better with Cubes, etc).

    Of course (2) won’t work if the [MYPOTENTIALDATE] field comes through as other things other than a DATETIME or NULL, i.e., sometimes it is a word like “hello”.

    Those are the options I would explore, good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ask this question because I'm not able to test it at the moment.
I want to ask a question about iPhone. Is it possible to retrieve the
I want to ask a question about iPhone. Is it possible to retrieve the
Question: Is it possible to construct a web page that has a script to
It's quite possible a question like this has been asked before, but I can't
Question So I've recently came up with some new possible projects that would have
My question is simple; is it possible to over object-orient your code? How much
This question is directly related to my previous question ASP.NET AJAX Is it possible
Here is my question, Would it be possible, knowing that classic asp support server-side
This question is about App domains and Sessions. Is it possible to have IIS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.