Validate column - by Column value while Import data from CSV File?

  • Hi,

    I have a requirement that imports CSV file data to Sql server tables.

    Steps need to do:

    1. Import csv data to sql temporary table

    2. validation of import data with sql server tables (column wise)

    3. Make DML operations with that import data.

    I got the solutions to steps 1,3.

    but i didnt get solution for column wise value validation at the sql server. Can any one help on this.

    Waiting for your reply,

    Thank you

  • What type of validation do you require? 'ISNUMERIC' and 'ISDATE' spring to mind immediately, but we don't know enough about what you require.

    An example of the data would be helpful.

    BrainDonor.

    Steve Hall
    Linkedin
    Blog Site

  • Hi Thank you for your response.

    Information:

    Importing null string from csv File to "Not Nullable" Integer column.

    Eg.,

    CSV Sql Server

    Column Name (Eno) Column Name (Eno) Not Null

    ------------------- -----------------------

    ""

    I want to validate the nullable data since the corresponding Sql column is not a nullable type.

    Thank You...

  • Using Books On Line

    Lool at the ISNULL function:

    ISNULL ( check_expression , replacement_value )

    check_expression

    Is the expression to be checked for NULL. check_expression can be of any type.

    replacement_value

    Is the expression to be returned if check_expression is NULL. replacement_value must be of a type that is implicitly convertible to the type of check_expresssion.

    Return Types

    Returns the same type as check_expression.

    Remarks

    The value of check_expression is returned if it is not NULL; otherwise, replacement_value is returned after it is implicitly converted to the type of check_expression,

    Or if you want to alter processing when an imported row has a NULL value in a particular column examine the IS NULL or IS NOT NULL functions

    Use the IS NULL or IS NOT NULL clauses to test for a NULL value.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply