ʹÓÃSQL SERVER´æ´¢¹ý³ÌʵÏÖÒøÐÐתÕËÒµÎñ
ÔÚÒøÐнðÈÚϵͳÖУ¬ÎÒÃdz£³£¶¼ÒªÊµÏÖÒøÐÐתÕËÕâÑùµÄÒµÎñ²Ù×÷£¬¶øÕâÖÖ½ðÈÚϵͳ²¢·¢ÐÔÏ൱¸ß£¬ÐèÒª¿¼ÂǵÄÈçºÎÌá¸ßÐÔÄܺͱ£Ö¤°²È«ÐÔµÈÏà¹ØµÄÎÊÌ⡣ʹÓô洢¹ý³ÌÀ´ÊµÏÖÒøÐÐתÕËÊÇÒ»¸öºÜºÃµÄÑ¡Ôñ¡£
SQL SERVERÊý¾Ý¿âÖеĴ洢¹ý³ÌÏà¶ÔÓÚÓ¦ÓóÌÐòÖÐÀ´²Ù×÷Transact-SQLÓïÑÔµÄÓÅȱµã£º
Óŵ㣺
1. ´æ´¢¹ý³ÌÒÑÔÚ·þÎñÆ÷×¢²á£¬Ô¤±àÒ룬´æ´¢¹ý³ÌÔ¤ÏȱàÒëºÃ·ÅÔÚÊý¾Ý¿âÄÚ£¬¼õÉÙ±àÒëÓï¾äËù»¨µÄʱ¼ä
2. ´æ´¢¹ý³Ì¿ÉÒÔÓÃÓÚ¼õÉÙÍøÂçͨÐÅÁ÷Á¿£¬´æ´¢¹ý³Ì´úÂëÖ±½Ó´æ´¢ÓÚÊý¾Ý¿âÖУ¬Ö´ÐеÄʱºòÖ»ÐèÒªÓ¦ÓóÌÐò´«µÝ²ÎÊý¼´¿É£¬¶ø²»ÐèÒªÕû¶ÎµÄT-SQL´úÂë´«µÝµ½Êý¾Ý¿âÖС£
3. ÖØÓÃÐԸߣ¬Ò»¶Î´æ´¢¹ý³Ì£¬¿ÉÒÔÔÚÓ¦ÓóÌÐòÖв»Í¬µÄλÖÃÀ´µ÷Óá£
4. ¿Éά»¤ÐԸߣ¬°ÑÕû¸öÒµÎñµÄ²Ù×÷·â×°ÔÚÒ»Æð£¬ÓÐÀûÓÚÒÔºó×ö´úÂëµÄÌæ»»²Ù×÷£¬¶øÓ¦ÓóÌÐò»áÔÚÈպ󲻶ϵÄά»¤ÖУ¬»áµ¼ÖÂTrancSQL¹ý³Ì´úÂë»á±äµÃÔ½À´Ô½¸´ÔÓ£¬Í¬Ê±£¬¸üд洢¹ý³Ìͨ³£±È¸üÐÂÓ¦ÓóÌÐò¼òµ¥µÄ¶à£¬¸üÐÂÓ¦¸Ã³ÌÐòÐèÒª±àÒ룬²¿Êð¡£
5. ʹÓûº´æ¸ÄÉÆÐÔÄÜ£¬±àÒëºÃµÄ´æ´¢¹ý³ÌÖ±½Ó½øÈëSQL SERVERµÄ»º´æÖУ¬Ê¹µÃÏ´ÎÖ´ÐеÄʱºò£¬ÄÜÂíÉϵ÷Ó᣶øÔÚSQL SERVER 2005ÖУ¬Ö´Ðмƻ®ÒÑÕë¶ÔËùÓÐ T-SQL Åú´¦Àí½øÐÐÁË»º´æ£¬Ð§Âʺʹ洢¹ý³Ì²î²»¶àÁË¡£
6. Ç¿ÖÆʹÓÃÊý¾Ý¿âÖеݲȫÈÏÖ¤»úÖÆ£¬Ê¹µÃÓ¦ÓóÌÐòµÄ°²È«ÐÔÌá¸ß£º
a) ¶Ô´æ´¢¹ý³ÌÏòÌض¨Óû§ÊÚȨ£¬Ò²¿ÉÒÔÌṩ¶ÔÌض¨Êý¾ÝµÄ·ÃÎÊ¡£
b) ÔöÇ¿´úÂ밲ȫ£¬Í¨¹ý´«µÝ²ÎÊýµÄ·½Ê½£¬ÄÜÓÐЧ·ÀÖ¹ SQL×¢Èë¡£
ȱµã£º
1. ¿ÉÒÆÖ²ÐÔ²î
a) ÓÉÓÚ´æ´¢¹ý³Ì½«Ó¦ÓóÌÐò°ó¶¨µ½ SQL Server£¬Òò´ËʹÓô洢¹ý³Ì·â×°ÒµÎñÂß¼½«ÏÞÖÆÓ¦ÓóÌÐòµÄ¿ÉÒÆÖ²ÐÔ¡£
b) Èç¹ûÓ¦ÓóÌÐòµÄ¿É
Ïà¹ØÎĵµ£º
參¿¼: http://brightsky006.blog.163.com/blog/static/22583668200962195059485/
°ÑSQL 2005µÄ±¸·ÝÎļþµ¼Èëµ½SQL 2000
ѧϰÕä²Ø 2009-07-21 09:50 ÔĶÁ616 ÆÀÂÛ0
×ֺţº ´ó´ó ÖÐÖРСС
µçÄÔÉÏ°²×°ÁËSQL Server 2005£¬ÏÖÔÚÏë»»»ØSQL2000À´£¬ ......
Ò»¡¢ÈçºÎ¶¯Ì¬´´½¨Óû§
1.ʹÓô洢¹ý³Ì
sp_addlogin (Transact-SQL)
´´½¨Ð嵀 SQL Server µÇ¼£¬¸ÃµÇ¼ÔÊÐíÓû§Ê¹Óà SQL Server Éí·ÝÑéÖ¤Á¬½Óµ½ SQL Server ʵÀý¡£
ÖØÒªÌáʾ£º
ºóÐø°æ±¾µÄ Microsoft SQL Server ½«É¾³ý¸Ã¹¦ÄÜ¡£Çë±ÜÃâÔÚеĿª·¢¹¤×÷ÖÐʹÓøù¦ÄÜ£¬²¢×ÅÊÖÐ޸ĵ±Ç°»¹ÔÚʹÓøù¦ÄܵÄÓ¦ÓóÌÐò¡£Çë¸ÄÓà CREAT ......
cdateÊÇdatetimeÀàÐ͵Ä×Ö¶Î
ͳ¼ÆÒ»ÄêµÄÈçÏÂ
select datepart(yy,cdate) as 'Ô·Ý',sum(cmoney) from consumption group by datepart(yy,cdate)
ͳ¼ÆÒ»ÔµÄÈçÏÂ
select datepart(mm,cdate) as 'Ô·Ý',sum(cmoney) from consumption where datepart(yy,cdate)=2009 group by datepart(mm,cdate)
ͳ¼ÆÒ»ÖÜ ......
SQL SERVER¶¨Ê±×÷ÒµµÄÉèÖ÷½·¨
תÌù×Ô£º http://www.cnblogs.com/stephencat/archive/2006/08/24/484918.html
Èç¹ûÔÚSQL Server ÀïÐèÒª¶¨Ê±»òÕßÿ¸ôÒ»¶Îʱ¼äÖ´ÐÐij¸ö´æ´¢¹ý³Ì»ò3200×Ö·ûÒÔÄÚµÄSQLÓï¾äʱ,
¿ÉÒÔÓùÜÀí->SQL Server´úÀí->×÷ÒµÀ´ÊµÏÖ¡£
1¡¢¹ ......
ʹÓÃscott/tigerÓû§ÏµÄemp±íºÍdept±íÍê³ÉÏÂÁÐÁ·Ï°£¬±íµÄ½á¹¹ËµÃ÷ÈçÏÂ
empÔ±¹¤±í(empnoÔ±¹¤ºÅ/enameÔ±¹¤ÐÕÃû/job¹¤×÷/mgrÉϼ¶±àºÅ/hiredateÊܹÍÈÕÆÚ/salн½ð/commÓ¶½ð/deptno²¿ÃűàºÅ)
dept²¿Ãűí(deptno²¿ÃűàºÅ/dname²¿ÃÅÃû³Æ/locµØµã)
¹¤×Ê £½ н½ð £« Ó¶½ð
1£®ÁгöÖÁÉÙÓÐÒ»¸öÔ±¹¤µÄËùÓв¿ÃÅ
2£®Áгöн½ð±È& ......