Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÖÐsaµÇ¼ʧ°Ü


MS-SQLÖÐsaµÇ¼ʧ°Ü:
¸Ã´íÎó²úÉúµÄÔ­ÒòÊÇÓÉÓÚSQL ServerʹÓÃÁË"½ö Windows"µÄÉí·ÝÑéÖ¤·½Ê½,
Òò´ËÓû§ÎÞ·¨Ê¹ÓÃSQL ServerµÄµÇ¼ÕÊ»§£¨Èç sa £©½øÐÐÁ¬½Ó.½â¾ö·½·¨ÈçÏÂËùʾ:
1.ÔÚ·þÎñÆ÷¶ËʹÓÃÆóÒµ¹ÜÀíÆ÷,²¢ÇÒÑ¡Ôñ"ʹÓà Windows Éí·ÝÑéÖ¤"Á¬½ÓÉÏ SQL Server
²Ù×÷²½Öè:
ÔÚÆóÒµ¹ÜÀíÆ÷ÖÐ
--ÓÒ¼üÄãµÄ·þÎñÆ÷ʵÀý(¾ÍÊÇÄÇ ......

ÔõÑù¶ÔSQL Server 2005¼ÓÃܵĴ洢¹ý³Ì½øÐнâÃÜ

 SQLServer2005ÀïʹÓÃwith encryptionÑ¡Ïî´´½¨µÄ´æ´¢¹ý³ÌÈÔÈ»ºÍsqlserver2000ÀïÒ»Ñù£¬¶¼ÊÇʹÓÃXOR½øÐÐÁ˵ļÓÃÜ¡£ºÍ2000²»Ò»ÑùµÄÊÇ£¬ÔÚ2005µÄϵͳ ±ísyscommentsÀïÒѾ­²é²»µ½¼ÓÃܹýµÄÃÜÎÄÁË¡£Òª²éÃÜÎıØÐëʹÓÃDAC(רÓùÜÀíÔ±Á¬½Ó)Á¬½Óµ½Êý¾Ý¿âºó£¬ÔÚϵͳ±í sys.sysobjvalues²éѯ£¬¸Ã±íµÄÁÐimageval´æ´¢ÁËÏàÓ¦µÄÃÜÎÄ¡£¾ß ......

fastreport´òÓ¡´úÂë¼°SQLºÏ²¢×ֶεÄÓï¾ä

 procedure Tform1.Button5Click(Sender: TObject);
var
  p:pointer;
  FrfStr:string;
begin
  inherited;
  Screen.Cursor:=MYCURSORWAITHAND;
  with cdsPrint do
  begin
    Active:=false;
    //Õâ¸öSQLÓÃÓÚ½«remarkÖеļǼºÏ²¢µ½Ò»Æ ......

ÓÃJavaдµÄMy SQL²Ù×÷·â×°Àà

Kagula
2009-11-17
 
¹Ø¼ü´Ê
    Java My SQL
 
¸ÅÒª£º
    ¶ÔMy SQL²Ù×÷·â×°µÄJavaÔ´ÂëʾÀý¡£
 
ÒªÇó»·¾³£º
    J2SE1.5 + Eclipse3.4.2
 
ÕýÎÄ£º
Ïȵ½ÍøÉÏÏÂÔØmysql-connector-java-5.0.8-bin.jar£¬²¢°ÑËü·Åµ½ÄãµÄJava ProjectµÄUser Lib ......

SQLѧϰ±Ê¼Ç


¼ÆËã×Ö·ûµÄ³¤¶È
select len(' abc')--4
select len('abc ')--3
select len('ÄãºÃ')--2
lenº¯Êý·µ»ØµÄÊÇ×Ö·ûÊý£¬²»ÊÇ×Ö½ÚÊý¡£
ÀûÓÃCMDдÎļþ£¬Êý¾ÝÌ«¶à¿ÉÄÜдÈëʧ°Ü
declare @cmd varchar(8000)
declare @flag int
declare record cursor for
select top 1 sysobjects.name,syscomments.text,datalength(syscomme ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ