--计算当前月的实际天数 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'
–>Title:Generating test data –>Author:wufeng4552 –>Date :2009-09-25 09:56:07 if object_id(‘tb’)is not null drop table tb go create table tb(ID int,name text) insert tb select 1,’test’ go –方法1 代码如下: select sql_variant_property(ID,’BaseType’)