Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2009
    Posts
    20

    Unanswered: SQl Server query

    Hi
    I wanna ask something...
    I have a table with the name Customers. I want my table in the field Cities have a value that will be always there(for example New York).
    How the syntax of my sql qyery will be???
    Is the default value the right property i ask ??
    I use SQL Server 2008 or 2005

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    You mean you want it to never be empty? Or you always want it to be New York? Or you want it to always be one from a list? Or a combination of the above?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    Quote Originally Posted by ThomasKain24
    Hi
    I wanna ask something...
    I have a table with the name Customers. I want my table in the field Cities have a value that will be always there(for example New York).
    How the syntax of my sql qyery will be???
    Is the default value the right property i ask ??
    I use SQL Server 2008 or 2005
    Set up another table Cities, with CityID, CityCode, CityName (would have more such as state, etc) with a PK on CityID, a field CityID in Customers with a FK to Cities.CityID.

  4. #4
    Join Date
    Mar 2009
    Posts
    20
    HTML Code:
    You mean you want it to never be empty? Or you always want it to be New York? Or you want it to always be one from a list? Or a combination of the above?
    Can you give me some examples with queries so i can practice tha cases you told me???

  5. #5
    Join Date
    Dec 2008
    Posts
    135
    use default constraint on that column the u can maintain a single record with out entering any data into that column(New York)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •