sqlÖÐlog onʲôÒâ˼
sql ÖÐµÄ log on ÓÃÓÚ½¨ÉèÊý¾Ý¿âÅþÁ¬£¬ÔÊÐíÓû§Ê¹ÓÃÖ¸¶¨µÄƾ֤£¨ÈçÓû§ÃûºÍÃÜÂ룩»á¼ûÌض¨Ãü¾Ý¿â¡£Óï·¨£ºlog on [as] {Óû§Ãû | ÅþÁ¬Ãû³Æ} [with ÃÜÂë | without password] ¿ÉʹÓòî±ðµÄ²ÎÊýÖ¸¶¨Óû§Æ¾Ö¤£¬Ã÷È·½ç˵ÃÜÂë»òÔÚ²»ÐèҪʱÃâÈ¥¡£log on Óï¾ä½öÔÚÅþÁ¬µ½Êý¾Ý¿â֮ǰʹÓÃÒ»´Î£¬ÓÐÖúÓÚ½¨Éèµ½Êý¾ÝÔ´µÄÇå¾²ÅþÁ¬¡£
SQL ÖÐµÄ LOG ON
ÔÚ SQL ÖУ¬LOG ON ÓÃÓÚ½¨ÉèÊý¾Ý¿âÅþÁ¬¡£ËüÔÊÐíÓû§Ê¹ÓÃÖ¸¶¨µÄƾ֤£¨ÈçÓû§ÃûºÍÃÜÂ룩»á¼ûÌض¨Ãü¾Ý¿â¡£
Óï·¨£º
LOG ON [AS] {Óû§Ãû | ÅþÁ¬Ãû³Æ} [WITH ÃÜÂë | WITHOUT PASSWORD]
µÇ¼ºó¸´ÖÆ
²ÎÊý£º
Óû§Ãû»òÅþÁ¬Ãû³Æ£ºÖ¸¶¨Òª½¨ÉèÅþÁ¬µÄÓû§»òÅþÁ¬Ãû³Æ¡£
WITH ÃÜÂ룺ָ¶¨ÓÃÓÚÅþÁ¬µÄÃÜÂë¡£
WITHOUT PASSWORD£ºÈôÊDz»ÐèÒªÃÜÂ룬ÔòʹÓôËÑ¡Ïî¡£
ÔõÑùʹÓãº
ҪʹÓà LOG ON£¬ÇëÔÚÅþÁ¬µ½Êý¾Ý¿â֮ǰÔÚ SQL ÅÌÎÊÖÐʹÓÃËü¡£ÀýÈ磺
LOG ON AS 'sa' WITH PASSWORD = 'MyPassword'
µÇ¼ºó¸´ÖÆ
Õ⽫ʹÓÃÓû§Ãû ‘sa’ ºÍÃÜÂë ‘MyPassword’ ½¨ÉèÓëÊý¾Ý¿âµÄÅþÁ¬¡£
×¢ÖØÊÂÏ
LOG ON Óï¾ä½öÔÚÅþÁ¬µ½Êý¾Ý¿â֮ǰʹÓÃÒ»´Î¡£
¹ØÓÚÄÚÖÃÓû§Æ¾Ö¤£¬Í¨³£Ê¹Óà WITH PASSWORD Ñ¡Ïî¡£
¹ØÓÚÍⲿÊý¾ÝÔ´£¬¿ÉÄÜÐèҪʹÓÃÅþÁ¬Ãû³ÆºÍ WITHOUT PASSWORD Ñ¡Ïî¡£
LOG ON Óë CONNECT Óï¾äÀàËÆ£¬µ« LOG ON ÓÃÓÚ SQL Server£¬¶ø CONNECT ÓÃÓÚ Oracle¡£
ÒÔÉϾÍÊÇsqlÖÐlog onʲôÒâ˼µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡