MYSQL语法与MsSql的区别


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

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