--计算当前月的实际天数 Create FUNCTION dbo.CalcDaysOfMonth (@time varchar(6)) RETURNS int AS BEGIN DECLARE @Days int DECLARE @Month int DECLARE @Year int SET @Year=SUBSTRING(@time,1,4) SET @Month=SUBSTRING(@time,5,6) if( @Month='1' OR @Month='3' OR @Month='5'
--计算当前月的实际天数 Create FUNCTION dbo.CalcDaysOfMonth (@time varchar(6)) RETURNS int AS BEGIN DECLARE @Days int DECLARE @Month int DECLARE @Year int SET @Year=SUBSTRING(@time,1,4) SET @Month=SUBSTRING(@time,5,6) if( @Month='1' OR @Month='3' OR @Month='5'
一、测试环境: 1。数据库:Sql Server 2008 2。测试表:15000记录,char类型主键,无其他索引 3。测试字段:ntext 类型,最大数据长度12000 二、测试语句: 1。select * from ProductTemp where ProductDesc like ‘2.168.70.236%’ 2。select * from ProductTemp where charindex(‘192.168.70.236’,ProductDesc)>0 3。select