Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Location
    Charleston, SC
    Posts
    8

    Unanswered: CONCAT function + SQL Sever 2005

    I cant find a clear answer to the syntax of concat in for SQL 2005. Can anyone help.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    it's still the same old plus sign
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Oct 2005
    Location
    Charleston, SC
    Posts
    8
    I figured out what I was doing wrong. I used text as my data type for the two fields I was trying to CONCAT. So when I did First_name + ' ' + Last_name is was treating the two columns as text and the blank space as a varchar. So i would execute.

  4. #4
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    don't use the text type for such small fields as first and last names. text is for big blobs of text longer than 8000 chars. I don't know anyone with such a long name.

    and in 2005, don't use text at all. use varchar(max) or nvarchar(max).

Posting Permissions

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