¡¾Õª¡¿´æ´¢¹ý³Ì±È½Ï¶¯Ì¬SQLµÄÓŵãÔÚÄÄÀï
´æ´¢¹ý³Ì¸ú¶¯Ì¬sqlÏà±ÈÓÐÈçÏÂÓŵ㣺
1¡¢ ´æ´¢¹ý³ÌÔÊÐí±ê×¼×é¼þʽ±à³Ì
´æ´¢¹ý³ÌÔÚ±»´´½¨ÒÔºó¿ÉÒÔÔÚ³ÌÐòÖỶà´Îµ÷Óöø²»±ØÖØбàд¸Ã´æ´¢¹ý³ÌµÄSQL
Óï¾ä¶øÇÒÊý¾Ý¿âרҵÈËÔ±¿ÉËæʱ¶Ô´æ´¢¹ý³Ì½øÐÐÐ޸ĵ«¶ÔÓ¦ÓóÌÐòÔ´´úÂëºÁÎÞÓ°ÏìÒò
ΪӦÓóÌÐòÔ´´úÂëÖ»°üº¬´æ´¢¹ý³ÌµÄµ÷ÓÃÓï¾ä´Ó¶ø¼«´óµØÌá¸ßÁ˳ÌÐòµÄ¿ÉÒÆÖ²ÐÔ
2 ¡¢´æ´¢¹ý³ÌÄܹ»ÊµÏֽϿìµÄÖ´ÐÐËÙ¶È
Èç¹ûijһ²Ù×÷°üº¬´óÁ¿µÄTransaction-SQL ´úÂë»ò·Ö±ð±»¶à´ÎÖ´ÐÐÄÇô´æ´¢¹ý³ÌÒª
±ÈÅú´¦ÀíµÄÖ´ÐÐËٶȿìºÜ¶àÒòΪ´æ´¢¹ý³ÌÊÇÔ¤±àÒëµÄÔÚÊ×´ÎÔËÐÐÒ»¸ö´æ´¢¹ý³Ìʱ²é
ѯÓÅ»¯Æ÷¶ÔÆä½øÐзÖÎöÓÅ»¯²¢¸ø³ö×îÖÕ±»´æÔÚϵͳ±íÖеÄÖ´Ðмƻ®¶øÅú´¦ÀíµÄTransaction-
SQL Óï¾äÔÚÿ´ÎÔËÐÐʱ¶¼Òª½øÐбàÒëºÍÓÅ»¯Òò´ËËÙ¶ÈÏà¶ÔÒªÂýһЩ
3 ¡¢´æ´¢¹ý³ÌÄܹ»¼õÉÙÍøÂçÁ÷Á¿
¶ÔÓÚͬһ¸öÕë¶ÔÊý¾ÝÊý¾Ý¿â¶ÔÏóµÄ²Ù×÷Èç²éѯÐÞ¸ÄÈç¹ûÕâÒ»²Ù×÷ËùÉæ¼°µ½µÄ
Transaction-SQL Óï¾ä±»×éÖ¯³ÉÒ»´æ´¢¹ý³ÌÄÇôµ±ÔÚ¿Í»§¼ÆËã»úÉϵ÷Óøô洢¹ý³Ìʱ
ÍøÂçÖд«Ë͵ÄÖ»ÊǸõ÷ÓÃÓï¾ä·ñÔò½«ÊǶàÌõSQL Óï¾ä´Ó¶ø´ó´óÔö¼ÓÁËÍøÂçÁ÷Á¿½µ
µÍÍøÂ縺ÔØ
4¡¢ ´æ´¢¹ý³Ì¿É±»×÷ΪһÖÖ°²È«»úÖÆÀ´³ä·ÖÀûÓÃ
ϵͳ¹ÜÀíԱͨ¹ý¶ÔÖ´ÐÐijһ´æ´¢¹ý³ÌµÄȨÏÞ½øÐÐÏÞÖÆ´Ó¶øÄܹ»ÊµÏÖ¶ÔÏàÓ¦µÄÊý¾Ý·Ã
ÎÊȨÏÞµÄÏÞÖƱÜÃâ·ÇÊÚȨÓû§¶ÔÊý¾ÝµÄ·ÃÎʱ£Ö¤Êý¾ÝµÄ°²È«
+++++
ÆÀÂÛ£º»¹ÊDz»Çå³þ¶þÕßµÄÇø±ð£¬ÊǶþÕßµÄÊý¾Ý½á¹¹²»Ò»ÑùÂð£¿Ò»¸öÉùÃ÷Ϊ´æ´¢¹ý³ÌµÄ±äÁ¿ÀàÐÍ£¬Ò»¸öÖ»ÊÇÆÕͨÒâÒåµÄ±äÁ¿Âð£¿
Á½¸öºÜºÃµÄÍøÕ¾
http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.esqlc.doc/esqlc299.htm
http://www.4js.com/exclude/en/html/fgl/User/fe_dynamicsql.html
Ïà¹ØÎĵµ£º
ÔÚijЩÇé¿öÏ£¬ÎÒÃÇ»áÐèÒªÖ±½ÓÓÉÊý¾Ý¿âÖÐÈ¥³ýһЩ×ÊÁÏ¡£Õâ¿ÉÒÔ½åÓÉ DELETE from Ö¸ÁîÀ´´ï³É¡£ËüµÄÓï·¨ÊÇ£º
DELETE from "±í¸ñÃû"
WHERE {Ìõ¼þ}
ÒÔÏÂÎÒÃÇÓøöʵÀý˵Ã÷¡£¼ÙÉèÎÒÃÇÓÐÒÔÏÂÕâ¸ö±í¸ñ£º
Store_Information ±í¸ñ
store_name
Sales
Date
Los Angeles
$1500
Jan-05-1999
San Diego
$250
Jan-0 ......
using (con)
{
con.Open();
String sqltext = "select * from emp where empno=@empno";
......
Êý¾Ý¿â²Ù×÷ÏÖÔÚÊÇÏîÄ¿¿ª·¢µÄ¸ù±¾£¬Ñ§Ï°JavaÊ×ÏÈÓ¦¸Ãѧ»áÔõôÑùÁ¬½ÓÊý¾Ý¿â£¬ÓÃJavaÁ¬½ÓÊý¾Ý¿â¿É²»ÏñÓÃDelphiÕâÀ๤¾ßÄÇÑùÉ輸¸öÊôÐÔ¾ÍOK£¬Ëµ¼òµ¥Ò²¼òµ¥£¬Ëµ¸´ÔÓ£¬ÆäʵҲͦ¸´Ôӵģ¬¶øÇÒºÜÂé·³£¬Èç¹ûÊdzõѧ£¬¸ù±¾²»Äܱ£Ö¤µÚÒ»´Î¾ÍÁ¬½Ó³É¹¦£¬ÏÂÃæÒÔSQL Server 2000ΪÀý£¬ËµËµJavaÁ¬½ÓÊý¾Ý¿âµÄ»ù±¾·½·¨£¬Ò²¼Ç¼һÏÂÐĵá£
1¡¢Ï ......
#region µÃµ½ËùÓб¾µØÍøÂçÖпÉʹÓõÄSQL·þÎñÆ÷Áбí
/// <summary>
/// µÃµ½ËùÓб¾µØÍøÂçÖпÉʹÓõÄSQL·þÎñÆ÷Áбí
/// </summary>
/// <param name="p_strServerList">·þÎñÆ÷Áбí</param& ......
--ÈÕÆÚת»»²ÎÊý,ÖµµÃÊÕ²Ø
select CONVERT(varchar, getdate(), 120 )2004-09-12 11:06:08
select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')20040912110608
select CONVERT(varchar(12) , getdate(), 111 )2004/09/12
select CONVERT(varchar(12) , getdate(), 112 )20040912 ......