Java code:
Ôõô½«ÏñÏÂÃæµÄ´øÌØÊâ×Ö·û(µ¥ÒýºÅ¡¢°Ù·ÖºÅ£¬Ë«ÒýºÅ£¬#ºÅ£¬ÃÀÔª·ûºÅ......)µÄ×Ö·û´®´æÈësqlserverµÄij¸ö×ֶΣ¿
String mystring="
insert into T_PUB_RZGL(N_RZID,N_RZLX,N_BMDM,N_YGGH,C_RZNR,C_RZSJ) values(10,6,9,412,'¸üÐÂÎÄ×Ö×ÊÁÏ,id£º'112' ¹ØÁªµ½Æ±Æ·¼ò³Æ£º325000',replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':',''))
"
Java code:
strSql = " insert into T_PUB_RZGL(N_RZID,N_RZLX,N_BMDM,N_YGGH,C_RZNR,C_RZSJ)" +
" values(" + iId + ","+strRzlx+","+strBmdm+","+strYggh + ",'"+ mystring +"','ʱ¼ä')
i=stmt.executeUpdate(strSql );
sqlserverÓÐûÓÐÏñPHPÄÇÑù½«sqlÓï¾ä¸ñʽ»¯Îª¿É´æ´¢×Ö·û´®µÄº¯Êý£¿
¼ÓN''
SQL code:
ESCAPE
¾ÍÊǵ¥ÒýºÅÒª´æÈëʱ ÓÃÁ½¸ö
declare @s varchar(10)
set @s = 'adfasdf''sadfasdfadf'
×¢ÒâÖмäµÄÁ½¸ö''
µ¥ÒýºÅµÄ»°,ÊÇÁ½µã±íÒ»µã,
SELECT ''''
ÕâÑùSQL code:
ÓÐÒ»ÕÅ±í£¬ÀïÃæÓÐ3¸ö×ֶΣºÓïÎÄ£¬Êýѧ£¬Ó¢Óï¡£ÆäÖÐÓÐ3Ìõ¼Ç¼·Ö±ð±íʾÓïÎÄ70·Ö£¬Êýѧ80·Ö£¬Ó¢Óï58·Ö£¬ÇëÓÃÒ»ÌõsqlÓï¾ä²éѯ³öÕâÈýÌõ¼Ç¼²¢°´ÒÔÏÂÌõ¼þÏÔʾ³öÀ´£¨²¢Ð´³öÄúµÄ˼·£©£º
´óÓÚ»òµÈÓÚ80±íʾÓÅÐ㣬´óÓÚ»òµÈÓÚ6 ......