Click here to Skip to main content
15,921,779 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
954-778-0978


what is the datatype to enter this number into the mysql?

can anyone help me....
Posted
Comments
Richard MacCutchan 3-Nov-15 4:47am    
That is just a string of characters. What is it supposed to represent?
Raghul vijay 3-Nov-15 6:15am    
its is a Customer_id number @Richard MacCutchan

VARCHAR or NVARCHAR - it looks like a phone number, so you need a string based datatype.
 
Share this answer
 
As suggested in the comment. this is just an ordinary string.
Use either the type VARCHAR, like VARCHAR(20), or CHAR, like CHAR(20).

You can read about the difference between the two datatypes here: 11.4.1 The CHAR and VARCHAR Types[^]
 
Share this answer
 
You can use a VARCHAR/NVARCHAR (it looks like a telephone number). You do not need an int because you are having - in between.

-KR
 
Share this answer
 
Comments
Raghul vijay 3-Nov-15 6:09am    
No, its not working in both the datatypes..... entering into my sql like 0000-00-00 this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900