Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2011
    Posts
    78

    Unanswered: Regarding Data type

    what data type should I use when I have different type of values in one column such as

    7801/7818/7848/7858
    7828
    7803 FTA 2&3
    and some null values


    At first I used numeric, then I realized there are some words. So I change it to varchar. But When I tried to imported the data from excel using the import wizard, it has errors. It seems like my datatype is not right. Please let me know if any one knows. Thank you.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    VARCHAR is the correct datatype for that data.

    The error message or messages will help you understand what you need to do to corect the error(s) that you are having.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    This may be a case where your data model is not normalised.

    Is there a difference between :
    7803 FTA 2&3
    and
    7803/FTA/2&3
    or between
    7801/7818/7848/7858
    and
    7801 7818 7848 7858
    ?

    Depending on your answer, VARCHAR is indeed the right data type, as Pat already indicated, or only part of the solution. But let's first await your answer.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  4. #4
    Join Date
    Jul 2011
    Posts
    78
    I tried Varchar again and I am able to import all the data in. But the problem is once I imported the data in, if I do a select statement. All the columns names are red but I am still able to retrieve data. I am not sure why.

  5. #5
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    Quote Originally Posted by Mangolili View Post
    All the columns names are red
    Que? No comprehendo.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  6. #6
    Join Date
    Jul 2011
    Posts
    78
    @ Thrasymachus
    I mean there's a red line under the column names, usually that means error. But I am able to query the data.Wonder why?


    I only understand a little bit of Spanish, but beyond that I don't understand. Please reply in English. Thank you.

  7. #7
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    Traductor Google es maravilloso una pieza de software. A veces, las columnas de la tabla temporal no va a resolver. se trata de una tabla temporal?
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •