Using SUBSTRING_INDEX() in SQL Server RRS feed

  • Question

  • Hi 

    I started SQL recently as a beginner i came across the above problem. the book i referring is using MySQL and i want to know how can i do the following in SQL Server 

    This is the query as per the example in the book

    SELECT SUBSTRING_INDEX(location, ',', 1) FROM my_contacts;

    Thanks in Advance 

    Thursday, January 23, 2014 4:59 PM


  • There is no equivalent function in SQL Server. We need to write our own function. 

    The below link would help you to do so:

    Function link

    Thursday, January 23, 2014 5:08 PM

All replies