这里是普通文章模块栏目内容页
MYSQL语法与MsSql的区别

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()