Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL ¿ØÖÆÁ÷³Ì

Transact-SQL ÌṩÁË(BEGIN...END¡¢BREAK¡¢GOTO¡¢CONTINUE¡¢IF...ELSE¡¢WHILE¡¢RETURN¡¢WAITFOR)¿ØÖÆÁ÷¹Ø¼ü×Ö£¬ÓÃÓÚ¿ØÖÆ Transact-SQL Óï¾ä¡¢Óï¾ä¿é¡¢Óû§¶¨Ò庯ÊýÒÔ¼°´æ´¢¹ý³ÌµÄÖ´ÐÐÁ÷¡£ ²»Ê¹ÓÿØÖÆÁ÷ÓïÑÔ£¬Ôò¸÷ Transact-SQL Óï¾ä°´Æä³öÏÖµÄ˳Ðò·Ö±ðÖ´ÐС£¿ØÖÆÁ÷ÓïÑÔʹÓÃÓë³ÌÐòÉè¼ÆÏàËƵĹ¹ÔìʹÓï¾äµÃÒÔ»¥ÏàÁ¬½Ó¡¢¹ØÁªºÍÏ໥ÒÀ´æ¡£ µ±¿ØÖÆÁ÷Óï¾ä²»ÄÜ¿ç¶à¸öÅú´¦Àí¡¢Óû§¶¨Ò庯Êý»ò´æ´¢¹ý³Ì¡£ Ò»¡¢ BEGIN...END BEGIN ºÍ END Óï¾äÓÃÓÚ½«¶à¸ö Transact-SQL Óï¾ä×éºÏΪһ¸öÂß¼­¿é(¼´Ï൱ÓÚCÓïÑÔÖÐ{}µÄ¹¦ÄÜ)¡£ Àý IF (@@ERROR 0)
BEGIN
   SET @ErrorSaveVariable = @@ERROR
   PRINT 'Error encountered, ' +
         CAST(@ErrorSaveVariable AS VARCHAR(10))
END ×¢Ò⣺ £¨1£©BEGIN ºÍ END Óï¾ä¿é±ØÐëÖÁÉÙ°üº¬Ò»Ìõ Transact-SQL Óï¾ä¡£ £¨2£©BEGIN ºÍ END Óï¾ä±ØÐë³É¶ÔʹÓã¬ÈκÎÒ»¸ö¾ù²»Äܵ¥¶ÀʹÓá£BEGIN¡¢ END ±ØÐëµ¥¶À³öÏÖÔÚÒ»ÐÐÖС£ BEGIN ºÍ END Óï¾äÓÃÓÚÏÂÁÐÇé¿ö£º £¨1£©WHILE Ñ­»·ÐèÒª°üº¬Óï¾ä¿é¡£ £¨2£©CASE º¯ÊýµÄÔªËØÐèÒª°üº¬Óï¾ä¿é¡£ £¨3£©IF »ò ELSE ×Ó¾äÐèÒª°üº¬Óï¾ä¿é¡£ ¶þ¡¢GOTO GOTO Óï¾äʹ Transact-SQL Åú´¦ÀíµÄÖ´ÐÐÌøÖÁ±êÇ©¡£²»Ö´ÐÐ GOTO Óï¾äºÍ±êÇ©Ö®¼äµÄÓï¾ä¡£Ê¹ÓÃÏÂÁÐÓï·¨¶¨Òå±êÇ©Ãû£º label_name:
¾¡Á¿ÉÙʹÓà GOTO Óï¾ä¡£¹ý¶àʹÓà GOTO Óï¾ä¿ÉÄÜ»áʹ Transact-SQL Åú´¦ÀíµÄÂß¼­ÄÑÓÚÀí½â¡£Ê¹Óà GOTO ʵÏÖµÄÂß¼­¼¸ºõÍêÈ«¿ÉÒÔʹÓÃÆäËû¿ØÖÆÁ÷Óï¾äʵÏÖ¡£GOTO ×îºÃÓÃÓÚÌø³öÉî²ãǶÌ׵ĿØÖÆÁ÷Óï¾ä¡£
±êÇ©ÊÇ GOTO µÄÄ¿±ê£¬Ëü½ö±êʶÁËÌøתµÄÄ¿±ê¡£±êÇ©²»¸ôÀëÆäÇ°ºóµÄÓï¾ä¡£Ö´ÐбêÇ©Ç°ÃæÓï¾äµÄÓû§½«Ìø¹ý±êÇ©²¢Ö´ÐбêÇ©ºóµÄÓï¾ä¡£³ý·Ç±êÇ©Ç°ÃæµÄÓï¾ä±¾ÉíÊÇ¿ØÖÆÁ÷Óï¾ä£¨Èç RETURN£©£¬ÕâÖÖÇé¿ö²Å»á·¢Éú¡£
ʾÀý
IF (SELECT SYSTEM_USER()) = 'payroll'
GOTO calculate_salary
-- Other program code would appear here.
-- When the IF statement evaluates to TRUE, the statements
-- between the GOTO and the calculate_salary label are
-- ignored. When the IF statement evaluates to FALSE the
-- statements following the GOTO are executed.
calculate_salary:
-- Statements to calculate a salary would appear after the label.
Èý¡¢IF...ELSE
IF Óï¾äÓÃÓÚÌõ¼þµÄ²âÊÔ¡£µÃµ½µÄ¿ØÖ


Ïà¹ØÎĵµ£º

sql 2005

“¹¤ÓûÉÆÆäÊ£¬±ØÏÈÀûÆäÆ÷”¡£ÐÅÏ¢¼¼ÊõÔÚÉÌÒµÁìÓòÓ¦ÓõÄ׿Խ³ÉЧÔÚ¾­¹ý½ü20ÄêµÄÐÅÏ¢»¯½¨ÉèÒѾ­³õ²½ÏÔÏÖ¡£Æóҵͨ¹ýMIS£¨¹ÜÀíÐÅϢϵͳ£©¿ìËÙÊÕ¼¯ºÍ´¦ÀíÉÌÒµÐÅÏ¢£¬Í¨¹ýERP£¨ÆóÒµ×ÊÔ´¼Æ»®ÏµÍ³£©×¼È·¼à¿ØÐÅÏ¢Á÷£¬´Ó¶ø¶ÔÆóÒµ¾­ÓªµÄ¸÷¸ö·½Ãæ½øÐйÜÀí¡£ÕâЩϵͳ³ýÁ˱¾ÉíµÄÓ¦ÓÃÍ⣬»¹»ýÀÛÁË´óÁ¿µÄÊý¾Ý£¬ÈçÀ´×ÔÒµÎñϵͳµÄ¶© ......

SQL SERVER Êý¾ÝÀàÐÍÏê½â

 
Êý¾ÝÀàÐÍ
ÀàÐÍ
Ãè              Êö
bit
ÕûÐÍ
bit Êý¾ÝÀàÐÍÊÇÕûÐÍ£¬ÆäÖµÖ»ÄÜÊÇ0¡¢1»ò¿ÕÖµ¡£ÕâÖÖÊý¾ÝÀàÐÍÓÃÓÚ´æ´¢Ö»ÓÐÁ½ÖÖ¿ÉÄÜÖµµÄÊý¾Ý£¬ÈçYes »òNo¡¢True »òFa lse ¡¢On »òOff
int
ÕûÐÍ
int Êý¾ÝÀàÐÍ¿ÉÒÔ´æ´¢´Ó- 231(-2147483648)µ½231 (21 ......

SQL×¢Èë

Ëæ×ÅB/SģʽӦÓÿª·¢µÄ·¢Õ¹£¬Ê¹ÓÃÕâÖÖģʽ±àдӦÓóÌÐòµÄ³ÌÐòÔ±Ò²Ô½À´Ô½¶à¡£µ«ÊÇÓÉÓÚÕâ¸öÐÐÒµµÄÈëÃÅÃż÷²»¸ß£¬³ÌÐòÔ±µÄˮƽ¼°¾­ÑéÒ²²Î²î²»Æ룬Ï൱´óÒ»²¿·Ö³ÌÐòÔ±ÔÚ±àд´úÂëµÄʱºò£¬Ã»ÓжÔÓû§ÊäÈëÊý¾ÝµÄºÏ·¨ÐÔ½øÐÐÅжϣ¬Ê¹Ó¦ÓóÌÐò´æÔÚ°²È«Òþ»¼¡£Óû§¿ÉÒÔÌá½»Ò»¶ÎÊý¾Ý¿â²éѯ´úÂ룬¸ù¾Ý³ÌÐò·µ»ØµÄ½á¹û£¬»ñµÃijЩËûÏëµÃÖªµÄÊ ......

SQL ͨÓô洢¹ý³Ì


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
/// <summary>
/ ......

SQL²éѯÓï¾ä´óÈ« T

 --Óï ¾ä                                ¹¦ ÄÜ
1¡¢Êý¾Ý²Ù×÷
Select      --´ÓÊý¾Ý¿â±íÖмìË÷Êý¾ÝÐкÍÁÐ
Insert & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ