Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sql Server Express /substring

    Im MySql
    Select substring_index(Description,' ',10)From Agent

    Give first 10 words Of Description From the table Agent


    What is its Sql Server Equallent

    Hope some one can help me


  • #2
    New Coder
    Join Date
    Jul 2006
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQlServer Express/Extracting Some word

    What I mean is
    I want to get the fuction (in SQlServer Express)
    for Extracting some words from a Long string

    sujith

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    SQL server does not have an equivalent for that. It cannot determine where wordboundaries are. The best you can do is use the LEFT(string, num) or the SUBSTRING(string, start, end) functions. They work on characters, take the first num characters from the start of the string (LEFT function), or take the characters from the string between the specified start and end number (SUBSTRING function)

    Otherwise you have to create a custom function which looks for wordboundaries and extracts the number of words you want.
    I am the luckiest man in the world


  •  

    Posting Permissions

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