regarding data types

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bhargavigupta
    New Member
    • Aug 2007
    • 15

    regarding data types

    hi ,
    in sql server 2005 i am creating a table with some fields like id,name etc in this i gave a field for U.S Phone number with datatype varchar, after i inserting the values in to the table it is taking '-' as minus and it is doing subtractions please help me how can i validate this field..........
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Originally posted by bhargavigupta
    hi ,
    in sql server 2005 i am creating a table with some fields like id,name etc in this i gave a field for U.S Phone number with datatype varchar, after i inserting the values in to the table it is taking '-' as minus and it is doing subtractions please help me how can i validate this field..........

    check the value being inserted. what's happening is the "minus" is happening before the insert. the sql server is automatically converting the expression into varchar. it could be a numeric value. since it thought it's an expression, it's validating the expression first before inserting

    Comment

    Working...