Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

declaring datatypes Expand / Collapse
Author
Message
Posted Sunday, July 25, 2010 10:21 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, September 19, 2010 8:51 PM
Points: 6, Visits: 13
which datatype is suitable for 'HSUB 9N380800 1010000.000000 USD' data in sql_server
Post #958552
Posted Sunday, July 25, 2010 10:50 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, August 1, 2014 6:18 AM
Points: 1,618, Visits: 20,980
I feel VARCHAR would suite this.

Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
Post #958557
Posted Monday, July 26, 2010 2:17 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:16 AM
Points: 40,194, Visits: 36,599
Is that a single attribute or 4 different values that need storing?


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
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

Post #958638
Posted Monday, July 26, 2010 9:31 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, September 19, 2010 8:51 PM
Points: 6, Visits: 13
Thanks fro response. What i have mentioned in above is single line.
thx
Post #958867
Posted Monday, July 26, 2010 10:18 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:16 AM
Points: 40,194, Visits: 36,599
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 2008, MVP
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

Post #958896
Posted Monday, July 26, 2010 10:25 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 8:55 AM
Points: 2,873, Visits: 5,185
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!"
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Post #958900
Posted Monday, July 26, 2010 10:28 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, September 19, 2010 8:51 PM
Points: 6, Visits: 13
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.
Post #958902
Posted Monday, July 26, 2010 10:32 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 8:55 AM
Points: 2,873, Visits: 5,185
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!"
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Post #958906
Posted Monday, July 26, 2010 10:33 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, September 19, 2010 8:51 PM
Points: 6, Visits: 13
Thank you.
Post #958908
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse