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

SQL Server ÎÞÕʺŻòÍü¼ÇÃÜÂëµÇ½ÎÊÌâ

Question 1£º
Êý¾Ý¿âµÄÑé֤ģʽΪWindowsÑéÖ¤£¬É¾³ýÁËMS SQL ServerÕʺÅBUILTIN\Administrators,µÇ½²»ÉÏSQL Server¹ÜÀíÆ÷£¿
Answer£º
      1.ÖØÐÂÔËÐÐMS SQL SERVERµÄ°²×°³ÌÐò£¬ÔÚ“°²×°Ñ¡ÏçÃæÀïÑ¡Ôñ“¸ß¼¶Ñ¡Ï¬ÏÂÒ»²½ºóÑ¡Ôñ“×¢²á±íÖØ½¨”£¬½ÓÏÂÀ´¸ú°²×°¹ý³Ì²î²»¶à£¬×¢ÒâÔÚÑ¡Ôñ“Éí·ÝÑé֤ģʽ”µÄʱºòÑ¡Ôñ“»ìºÏģʽ”£¬Ä¿µÄÊÇʹsaÕÊ»§ÓÐЧ¡£
      2.ÖØ½¨Íê³ÉÒÔºó£¬Óòéѯ·ÖÎöÆ÷£¬Ê¹ÓÃsaÕÊ»§µÇ¼£¬ÔÚ²éѯ·ÖÎöÆ÷ÀïÖ´ÐÐ sp_grantlogin 'builtin\administrators'£¬ÕâÑù¾Í»Ö¸´windowsÉí·ÝÑéÖ¤ÁË¡£
Question 2£º
Êý¾Ý¿âµÄÑé֤ģʽΪ»ìºÏÑéÖ¤£¬ÎÞsaÕʺŵÄÃÜÂ룬ɾ³ýÁËMS SQL ServerÕʺÅBUILTIN\Administrators,µÇ½²»ÉÏSQL Server¹ÜÀíÆ÷£¿
Answer£º 
      1.°ÑMSsqlserver·þÎñÍ£Ö¹£¬°Ñ master.mdfºÍmastlog.ldf Îļþ¿½±´³öÀ´¡£
      2.ÔÚ±ðµÄsqlserver·þÎñÆ÷ÉÏ£¬°ÑÎļþ¸½¼Ó³ÉÊý¾Ý¿âAAA(Êý¾Ý¿âÃû³Æ×Ô¼º¾ö¶¨£¬ÕâÀï¼ÙÉèÊÇAAA),È»ºóÖ´ÐÐ update AAA..sysxlogins set  password=null   where   name='sa'  
      3.°Ñmaster.mdfºÍmastlog.ldfÁ½¸öÎļþ¸²¸Çµ½SQL Server°²×°Ä¿Â¼µÄdataĿ¼Ï£¬Æô¶¯SQL Server£¬´ËʱsaÃÜÂëΪ¿Õ.


Ïà¹ØÎĵµ£º

SQLÖÐCASEʹÓÃ

 ½ñÌìÔÚÏîÄ¿ÖÐÓÐÒ»ÎÊÌ⣬ÔÚÍøÉϲéѯÁËcaseµÄÓ÷¨£¬Ìû³öÀ´ºÍ´ó¼Ò·ÖÏíÏ¡£
 ÎÊÌâÃèÊö£ºÔÚÒ»ÕűíÖÐÓÐÒ»×Ö¶ÎbitÀàÐÍ£¬±íʾ´ËÌõÊý¾ÝÊÇ·ñ±»Ëø¶¨£¬ÔÚÒ³ÃæÉÏÓÐÒ»°´Å¥ÊǶԴËÌõÊý¾Ý½øÐÐËø¶¨ºÍ½âËøµÄ£¬Ñ¡ÔñÒ³ÃæÖеÄÊý¾Ý£¬µã»÷Õâ¸ö°´Å¥£¬Èç¹ûÕâÌõÊý¾ÝÊÇËø¶¨µÄ£¬¾Í½âËø£»Èç¹ûÊÇδ˵¶¨µÄ¾ÍËø¶¨£¬ÕâÑù¾ÍÓÃÒ»ÌõÓï¾äÀ´ÊµÏÖ¡£ºóÀ´Ï ......

sql ÖÐOBJECT_ID º¯ÊýµÄ½âÊÍ

ÔÚÁгö±íÖÐËùÓÐ×Ö¶ÎÃûµÄʱºò£¬Óõ½ÁËÕâÑùÒ»¸öSQLº¯Êý£ºobject_id
ÕâÀïÎÒ½«Æä×÷ÓÃÓëÓ÷¨ÁгöÀ´£¬ºÃÈôó¼ÒÃ÷°×£º
OBJECT_ID£º
·µ»ØÊý¾Ý¿â¶ÔÏó±êʶºÅ¡£
Óï·¨
OBJECT_ID ( 'object' )
²ÎÊý
'object'
ҪʹÓõĶÔÏó¡£object µÄÊý¾ÝÀàÐÍΪ char »ò nchar¡£Èç¹û object µÄÊý¾ÝÀàÐÍÊÇ char£¬ÄÇôÒþÐÔ½«Æäת»»³É ncha ......

Ô¶³Ì±¸·ÝsqlÊý¾Ý¿âµ½±¾»ú

 Ìõ¼þ£º
    ÓµÓÐsaȨÏÞ
    ¿ªÆô xp_cmdshell
·½·¨£º
 ¿ªÆô/¹Ø±Õ xp_cmdshell ±ØÐëÔÚ master  ¿âÖ´ÐÐ
EXEC sp_configure 'show advanced options', 1 
RECONFIGURE WITH OVERRIDE 
EXEC sp_configure 'xp_cmdshell', 1 
RECONFIGURE ......

pl/sql(1)

1 PLS_INTEGER
PLS_INTEGER¿ÉÒÔ´æ´¢Ò»¸öÓзûºÅµÄÕûÐÎÖµ£¬Æä¾«¶È·¶Î§ºÍBINARY_INTEGERÒ»Ñù£¬ÊÇ£º-2^31~2^31¡£
PLS_INTEGERºÍNUMBER±È½ÏÆðÀ´£¬ÆäÓŵãÊÇ£º
1).Õ¼ÓнÏÉٵĴ洢¿Õ¼ä£»
2).¿ÉÒÔÖ±½Ó½øÐÐËãÊõÔËË㣨ÔÚNUMBERÉϲ»ÄÜÖ±½Ó½øÐÐËãÊõÔËË㣬Èç¹ûÒª¼ÆË㣬NUMBER±ØÐëÏȱ»×ª»»³É¶þ½øÖÆ£©¡£ËùÒÔÔÚ½øÐÐËãÊõµÄʱºòPLS_INTEGER ......

SQL Server2005ËĸöÅÅÐòº¯Êý¼ò½é

ÅÅÃûº¯ÊýÊÇSQL Server2005мӵŦÄÜ¡£ÔÚSQL Server2005ÖÐÓÐÈçÏÂËĸöÅÅÃûº¯Êý£º
1. row_number ×Ô¶¯Éú³ÉÐкÅ,ÐòºÅÓÉorder by ×ֶξö¶¨
2. rank over Filed, ÓÉrank overµÄ×ֶξö¶¨£¬Ãû´Î²»Á¬Ðø£¬ÈçÓÐ3¸ö²¢ÁеÚÒ»Ãû£¬ÔòºóÐøÃû´ÎÖ±½Ó´Ó4¿ªÊ¼
3. dense_rank£¬ºÍrankÏàËÆ£¬Ö»ÊÇÃû´ÎÁ¬Ðø£¬ÈçÓÐ3¸ö²¢ÁеÚÒ»Ãû£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ