Updated: 30 April 2009
Use STARTSWITH to determine if a string starts with a particular value.
SELECT [wctString].[wct].[STARTSWITH] (
is the text to be searched. The @Text argument can be of data types that are implicitly convertible to nvarchar or ntext.
is the value to search for in @Text. The @Value argument can be of data types that are implicitly convertible to nvarchar or ntext.
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.
· STARTSWITH does not support the use of wildcards.
· STARTSWITH supports case sensitive searches. @CaseSensitive = 1, makes the search case sensitive.
select wct.STARTSWITH('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.'
This produces the following result
(1 row(s) affected)