--计算当前月的实际天数 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 database CRM; --删除数据库 drop database CRM; --创建一个表 if exists(select * from sysobjects where name='Users') drop table Users go create table Users( Id int identity(1,1) not null primary key, --顾客编号,主键 按一进行自动增长 UserName varchar(50)not nul