declaring datatypes

  • which datatype is suitable for 'HSUB 9N380800 1010000.000000 USD' data in sql_server

  • I feel VARCHAR would suite this.

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • Is that a single attribute or 4 different values that need storing?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks fro response. What i have mentioned in above is single line.

    thx

  • I can see it's a single line. What I'm asking is whether that should be a single column or multiple. It looks like there are multiple things in there. If so, they should be stored in separate columns, not stuffed into one.

    Database design - first normal form - all attributes should be atomic (cannot be broken down)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • How are you going to name this column?

    If it's Comments then varchar can be used.

    If it's intended be "Details", then follow Gail advise and split it into separate columns, for example:

    SomeCode CHAR(4),

    AnotherCode CHAR(8),

    Amount DECIMAL(19,6),

    CurrencyCode CHAR(3)

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • Thanks for your response.

    In my requirement table has some columns among one column name is

    TRANSACTION_DESCRIPTION

    HSUB 9N350820 1010000.000000 USD

    HSUB 9N380800 1010000.000000 USD

    HSUB 9N381500 1010000.000000 USD

    HSUB 9N383290 1010000.000000 USD

    Above are the values under the column TRANSACTION_DESCRIPRTION.

    THX.

  • Then VARCHAR. Give it some relevant size based on sample of data you have. It looks like extract from other system, so you may ask for specification describing maximum length for this field...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • Thank you.

Viewing 9 posts - 1 through 8 (of 8 total)

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