Login     Register

        Contact Us     Search

XLeratorDB/strings Online Documentation

SQL Server ends-with string function


ENDSWITH

Updated: 30 April 2009

Use ENDSWITH to determine if a string ends with a particular value.
Syntax
SELECT [wctString].[wct].[ENDSWITH] (
   <@Text, nvarchar(max),>
 ,<@Value, nvarchar(max),>
 ,<@CaseSensitive, bit,>)
Arguments
@Text
is the text to be searched. The @Text argument can be of data types that are implicitly convertible to nvarchar or ntext.
 
@Value
is the value to search for in @Text. The @Value argument can be of data types that are implicitly convertible to nvarchar or ntext.
 
@CaseSensitive
declares the search as being either case sensitive or case insensitive, regardless of collation. The @CaseSenstive argument must be of data types that are implicitly convertible to bit.
 
Return Types
bit
Remarks
·         ENDSWITH does not support the use of wildcards.
·         ENDSWITH supports case sensitive searches. @CaseSensitive = 1, makes the search case sensitive.
Examples
 
select wct.ENDSWITH('Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.'
,'equal.'
,0)
 
This produces the following result
-----
1
 
(1 row(s) affected)

 



Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service