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

ʹÓÃTRY/CATCHÓï¾ä½â¾öSQL Server 2005ËÀËø

      ÈÃÎÒÃÇ´ÓÕâÑùÒ»¸öʾÀý¿ªÊ¼ËµÆð£¬ËüÔÚ SQL Server 2000 ºÍ 2005 Öж¼ÄÜÒýÆðËÀËø¡£ÔÚ±¾ÎÄÖУ¬ÎÒʹÓà SQL Server 2005 µÄ×îРCTP£¨ÉçÇø¼¼ÊõÔ¤ÀÀ£¬Community Technology Preview£©°æ±¾£¬SQL Server 2005 Beta 2£¨7 Ô·¢²¼£©Ò²Í¬ÑùÊÊÓá£Èç¹ûÄúûÓÐ Beta 2 »ò×îÐ嵀 CTP °æ±¾£¬ÇëÏÂÔØ SQL Server 2005 Express µÄ×îа汾£¬ÓÃËüÀ´½øÐÐÊÔÑé¡£
  ¿ÉÄÜ·¢ÉúµÄËÀËøÇé¿öÓкܶ࣬[²ÎÔÄhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_con_7a_3xrf.aspÒÔ¼°ËÀËøÎÄÕÂÊ÷ÖеĺóÐøÎÄÕ¡£— ±àÕß ]£¬µ«×îÓÐȤ¡¢×î΢ÃîµÄÊÇÄÇЩ¹ØÓÚÔĶÁÆ÷ºÍ±àдÆ÷»¥Ïà×èÈûµÄËÀËø¡£ÒÔÏ´úÂëÔÚ pubs Êý¾Ý¿âÖоͲúÉúÁËÕâÑùÒ»¸öËÀËø¡££¨Äú¿ÉÒÔÔÚ SQL Server 2000 µÄÁ½¸ö Query Analyzer ´°¿ÚÖлò SQL Server 2005 µÄÁ½¸ö Management Studio queries Öв¢ÁÐÔËÐÐÕâ¶Î´úÂë¡££©ÔÚÆäÖÐÒ»¸ö´°¿ÚÖеĴúÂëÕýÎÄÇ°ÃæÌí¼ÓÏÂÁÐÓï¾ä£º
-- Window 1 header
DECLARE @au_id varchar(11), @au_lname varchar(40)
SELECT @au_id = '111-11-1111', @au_lname = 'test1'
ÔÚµÚ¶þ¸ö´°¿ÚÖÐÌí¼ÓÏÂÁÐÓï¾ä£¬½øÐеڶþ´ÎÁ¬½Ó£º
-- Window 2 header
DECLARE @au_id varchar(11), @au_lname varchar(40)
SELECT @au_id = '111-11-1112', @au_lname = 'test2'
ÔÚÁ½¸ö´°¿ÚÖж¼Ê¹ÓÃÏÂÁÐÓï¾ä×÷Ϊ´úÂëÕýÎÄ£º
-- Body for both connections:
BEGIN TRANSACTION
INSERT Authors VALUES
  (@au_id, @au_lname, '', '', '', '', '', '11111', 0)
WAITFOR DELAY '00:00:05'
SELECT *
  from authors
  WHERE au_lname LIKE 'Test%'
COMMIT
ÔÚµÚÈý¸ö´°¿ÚÖÐÔËÐÐÏÂÁÐÓï¾ä£¬È·±£ authors ±í¸ñÖÐûÓÐÈκΰüº¬ÒÔÏ id µÄÊý¾Ý£º
DELETE from authors WHERE au_id = '111-11-1111'
DELETE from authors WHERE au_id = '111-11-1112'
ÔÚ 5 ÃëÖÓÄÚͬʱִÐд°¿Ú 1 ºÍ ´°¿Ú 2¡£ÒòΪÿ¸ö´°¿Ú¶¼ÒªµÈ´ýÖÁÉÙ 5 ÃëÖÓµÄʱ¼ä²ÅÄÜ·¢³ö SELECT Óï¾ä£¬ËùÓÐÿ¸öÁ¬½Ó¶¼½«Íê³É INSERT ²Ù×÷£¬ÕâÑù¾Í±£Ö¤ÁËÁ½¸ö´°¿ÚÖÐµÄ INSERT ²Ù×÷ÔÚ¸÷×﵀ SELECT Óï¾ä·¢²¼Ç°¾ÍÒѾ­Íê³ÉÁË¡£Ã¿¸ö´°¿ÚÖÐµÄ SELECT Óï¾ä¶¼³¢ÊÔ¶ÁÈ¡ authors ±í¸ñÖеÄËùÓÐÊý¾Ý£¬²éÕÒ au_lname ×Ö¶ÎÖµÖÐÀàËÆ“Test%”¸ñʽµÄÊý¾Ý¡£Òò´Ë£¬Á½¸ö´°¿ÚÖÐµÄ SELECT Óï¾ä¶¼½«³¢ÊÔ¶ÁÈ¡¸÷×ÔÁ¬½ÓÖеIJåÈëÊý¾Ý — Ò²¶ÁÈ¡¶Ô·½Á¬½ÓÖеIJåÈëÊý¾Ý¡£
read COMMITTED ¸ôÀ뼶±ðͨ¹ý·¢²¼¹


Ïà¹ØÎĵµ£º

SQL²éѯÓï¾ä¾«»ª

 Ò»¡¢ ¼òµ¥²éѯ
¼òµ¥µÄTransact-SQL²éѯֻ°üÀ¨Ñ¡ÔñÁÐ±í¡¢from×Ó¾äºÍWHERE×Ӿ䡣ËüÃÇ·Ö±ð˵Ã÷Ëù²éѯÁС¢²éѯµÄ
±í»òÊÓͼ¡¢ÒÔ¼°ËÑË÷Ìõ¼þµÈ¡£
ÀýÈ磬ÏÂÃæµÄÓï¾ä²éѯtesttable±íÖÐÐÕÃûΪ“ÕÅÈý”µÄnickname×ֶκÍemail×ֶΡ£
SELECT nickname,email
from testtable
WHERE name='ÕÅÈý'
(Ò») Ñ¡ÔñÁÐ ......

ORACLE PL/SQL ¼Ç¼(Record)ѧϰ±Ê¼Ç(Ò»)

ÔÚPL/SQL³ÌÐòÉè¼ÆÖУ¬ÓÐÈýÖÖ¶¨Òå¼Ç¼ÀàÐ͵ķ½·¨£ºÒ»ÖÖÊÇʹÓÃ%ROWTYPEÊôÐÔ£»ÁíÒ»ÖÖÊÇÔÚPL/SQL³ÌÐòµÄÉùÃ÷²¿·ÖÏÔʾ¶¨Òå¼Ç¼ÀàÐÍ£»×îºóÒ»ÖÖ·½·¨Êǽ«¼Ç¼ÀàÐͶ¨ÒåΪÊý¾Ý¿â½á¹¹»ò¶ÔÏóÀàÐÍ¡£
ÎÒÏȼòµ¥µÄ½éÉÜÒ»¸öÏÂÃæÒªÓõ½µÄ±íµÄ½á¹¹£¨ºÚÌå±êÃ÷µÄ×Ö¶ÎΪÖ÷¼ü£©£º
INDIVIDUALS±í
 
INDIVIDUAL ID
FIRST NAME
MIDDLE_INITI ......

ORACLE PL/SQL ¼¯ºÏѧϰ±Ê¼Ç(Èý)

ËÄ¡¢ÁªºÏÊý×éµÄʹÓ÷½·¨
ÁªºÏÊý×éÒÔÇ°±»³ÆΪPL/SQL±í¡£ÔÚ±íÖв»ÄÜʹÓÃÁªºÏÊý×飬ֻÄܽ«ËüÃÇÓÃ×÷³ÌÐòÉè¼ÆµÄ½á¹¹Ìå¡£Ö»ÄÜÔÚPL/SQLÖзÃÎÊÁªºÏÊý×é¡£
×¢Òâµ½ÁªºÏÊý×é´øÀ´µÄһЩ¹Ø¼üÎÊÌâÊǷdz£ÖØÒªµÄ¡£ÕâЩÎÊÌâʹÎÒÃǽéÉÜËüÃǵÄÓ÷¨Ê±£¬ÐèÒª²ÉȡһЩÌرðµÄ·½·¨¡£ÕâЩÎÊÌâ°üÀ¨£º
ÁªºÏÊý×é²»ÐèÒª³õʼ»¯£¬Ò²Ã»Óй¹Ô캯ÊýÓï·¨¡£ÔÚ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ