Sir, I am a bit confused of the data types and value to be stored in database.
Could you tell me the suitable datatype for the below values:-
1)Phone Number //what happen when use bigint
2)Name code(may have letters and digits)
3) 12/11/2013 ( I am getting error when use DateTime.can use smallDateTime?)
Loading

Sanjeeb LenkaPosted Aug 31, 2013, 5:46 AM
you can use.
Rosi Sreenivasa ReddyPosted Aug 31, 2013, 5:37 AM
if u don't mine can say numeric can be used or not....
i have a some doubt about that....
Sanjeeb LenkaPosted Aug 31, 2013, 5:20 AM
we use numeric to store decimal values.
There is no difference between NUMERIC and DECIMAL data types. They are synonymous to each other and either one can be used. DECIMAL/NUMERIC data types are numeric data types with fixed precision and scale.
In declaring a DECIMAL or NUMERIC data type, p, which is the precision, specifies the maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision of 38. The s is the scale and it specifies the maximum number of decimal digits that can be stored to the right of the decimal point. Scale, which defaults to 0 if not specified, must be a value from 0 to the precision value.
The following table specifies the storage size required based on the precision specified for the NUMERIC or DECIMAL data type:
you can check this link
http://technet.microsoft.com/en-us/library/ms187746.aspx
Rosi Sreenivasa ReddyPosted Aug 31, 2013, 5:11 AM
can you give
1)phone number:Numeric
what is your answer?
Sanjeeb LenkaPosted Aug 31, 2013, 3:45 AM
use this:
Phone Number: nvarchar(50)( bigint will work but some country mobile no format is different so we use navrchar)
NameCode: nvarchar(50)
date: datetime (but it will take mm/dd/yyyy format)