Author:水如烟
USE
[
LzmTW
]
GO
-- ===========================================================
-- Author: LzmTW
-- Create date: 20080110
-- Description: 确定字符串的开头是否与指定的字符串匹配
-- ===========================================================
CREATE FUNCTION [ String ] . [ StartWith ]
(
@Value nvarchar ( max )
, @Start nvarchar ( max )
)
RETURNS bit
AS
BEGIN
IF @Value IS NULL OR @Start IS NULL
RETURN NULL
DECLARE
@Result bit
IF LEFT ( @Value , [ String ] . Len ( @Start )) = @Start
SET @Result = 1
ELSE
SET @Result = 0
RETURN @Result
END
GO
-- ===========================================================
-- Author: LzmTW
-- Create date: 20080110
-- Description: 确定字符串的开头是否与指定的字符串匹配
-- ===========================================================
CREATE FUNCTION [ String ] . [ StartWith ]
(
@Value nvarchar ( max )
, @Start nvarchar ( max )
)
RETURNS bit
AS
BEGIN
IF @Value IS NULL OR @Start IS NULL
RETURN NULL
DECLARE
@Result bit
IF LEFT ( @Value , [ String ] . Len ( @Start )) = @Start
SET @Result = 1
ELSE
SET @Result = 0
RETURN @Result
END