1,选择语句:
* 每句后加分号;
* else if 应为elseif,中间不留空格。mssql为:if begin … end else if begin … end 形式
IF ( _TranType=’Insert’ ) THEN
INSERT INTO bmdcustomer(CustomerName,CustomerAddress,tel,Remark,Type,LastEditBy,LastEditDate)
VALUES(_CustomerName,_CustomerAddress,_tel,_Remark,_Type,_LastEditBy,now());
SET _Id = @@IDENTITY;
ELSEIF ( _TranType=’Update’ ) THEN
INSERT INTO bmdcustomer(CustomerName,CustomerAddress,tel,Remark,Type,LastEditBy,LastEditDate)
VALUES(_CustomerName,_CustomerAddress,_tel,_Remark,_Type,_LastEditBy,now());
SET _Id = @@IDENTITY;
ELSE
SELECT 1;
END IF;
2,日期:当前时间,Mysql: now(), MsSql:getdate()
上一篇: MySql远程连接账号建立
下一篇: mysql 定时运行