CONCATE_WS Not Recognizable

  • I am trying to use the CONCATE_WS function in SQL Server 2016 but receive the following error.  Here is my code and the error.  Why is this not working and is there a fix?  I need to be able to separate the concatenated columns.  Intellisense will pick CONCATE_WS up as a selectable option as I am writing the code even and displays as pink (color of functions in my ssms).  Please Help.  Thank you

    select ReceiptNum, CONCAT_WS(', ',[1],[2],[3]) AS Reference from #pivot

    Msg 195, Level 15, State 10, Line 19

    'CONCAT_WS' is not a recognized built-in function name.

  • As indicated in the documentation, CONCAT_WS is only available with SQL Server 2017 and higher:

    CONCAT_WS (Transact-SQL)

    Sue

     

  • I have the same problem, but I am on  Microsoft SQL Server 2016 (SP2-CU12) ...   when I hover over it, it also says "built-in function" , but the errror message 'CONCAT_WS' is not a recognized built-in function name. comes up, when I try to use itconcat

    Christoph Kauflin
    working in Controlling, but trying to program the tools we need to do that

  • Since Sue's message nothing has changed. SQL Server 2016 does not have the CONCAT_WS function.

     

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Thanks, my bad. I am a little embarrassed. I somehow misread and had 2012 or 2008 in the back of my mind. But I also think that the tool-tip when I hover over it, and the fact that it is in red are a little bit confusing, I looks like it would be a working function. Concat and concat_ws look the same on my computer, one is working and one not. But that is probably because the Studio is a higher version.

    Christoph Kauflin
    working in Controlling, but trying to program the tools we need to do that

  • christoph.kauflin wrote:

    Thanks, my bad. I am a little embarrassed. I somehow misread and had 2012 or 2008 in the back of my mind. But I also think that the tool-tip when I hover over it, and the fact that it is in red are a little bit confusing, I looks like it would be a working function. Concat and concat_ws look the same on my computer, one is working and one not. But that is probably because the Studio is a higher version.

    It's the lovely interface tool that you write code with.  There have been numerous times where I've noticed code that gets re-colored as being a keyword only to find out that it's not even a keyword in T-SQL.  Rather, it's from SSIS, SSAS, SSRS, or some other tool.

    The documentation isn't always helpful either.  Some "forever" keywords no longer show that they're still valid as far back as SQL Server 6.x or earlier.  Some don't even show that they're even available as of 2008.  It's Microsoft's way of "helping" us decide to upgrade. 😀

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • This was removed by the editor as SPAM

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply