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

ÈçºÎÓÐЧµÄ·ÀÖ¹SQLÁ¬½Ó×Ö·û´®×¢Èë

 ¸ÅÄÔÚ±àд°²È«´úÂëʱ£¬×îÖØÒªµÄ¹æÔòÖ®Ò»¾ÍÊÇ“¾ø¶Ô²»ÒªÃ¤Ä¿µÄÏàÐÅÓû§µÄÊäÈ딡£
ÀûÓÃADO.NET 2.0µÄSqlConnectionStringBuilderÀàÉú³ÉÊý¾Ý¿âÁ¬½Ó×Ö·û´®£¬Ëü¿ÉÒÔÓÐЧµÄ·ÀÖ¹“SQLÁ¬½Ó×Ö·û´®¶ñÒâ×¢È딣¬ÒòΪÕâ¸öÀàÊÇרÃÅΪSQL SERVERÉè¼ÆµÄËùÒÔ£»Ëü¼æÈݾÉʽ¹Ø¼ü×Ö¡£¹ØÓÚÈçºÎʹÓÃSqlConnectionStringBuilderÀ࣬Çë²Î¿¼ÎÒÒÔǰдµÄһƪ“ÖÇÄÜÊý¾Ý¿âÁ¬½ÓÉú³ÉÆ÷”ÎÄÕÂÀï¡£
·ÀÖ¹SQLÊý¾Ý¿âÁ¬½Ó×Ö·û´®Ê¾Àý
C#ºǫ́ʾÀý´úÂ룺
SqlConnectionStringBuilder bldr = new SqlConnectionStringBuilder();
bldr.DataSource = @".\SQLExpress";
bldr.InitialCatalog = "Pubs";
bldr.UserID = textBox1.Text;
bldr.Password = textBox2.Text;
¸Õ²Å¿´µ½Ç°Ì¨Óû§ÔÚÓû§ÃûÊäÈëµÄÓû§Ãû×Ö·û´®£¬¾ÍÊǶñÒâSQL×¢È룬¶øSqlConnectionStringBuilder»á°Ñ
“Óû§Ãû£»Data Source=Northwind”µÄ×Ö·û´®×÷Ϊ“UesrID”À´µÇ¼Êý¾Ý¿â¡£Õâ¾Í·ÀÖ¹¶ñÒâµÄ×¢ÈëÁË¡£
×îºóÏ£ÍûÄܺÍ־ͬµÀºÏµÄ¿ª·¢Í¬Ö¾£¬Ò»Æðѧϰ£¬Ò»Æð·ÖÏí¡£Ð»Ð»
ÍÆ¼öÁ´½Ó:»ÝÆÕºÚ°×¼¤¹â´òÓ¡»ú/°®ÆÕÉúÕëʽ´òÓ¡»ú


Ïà¹ØÎĵµ£º

DBAµÄSQL Server 2005±¸·Ýά»¤¼Æ»®

×÷ΪһÃûDBA£¬ËûÃÇ×î³£¼ûµÄÈÕ³£ÈÎÎñÊÇ£º
1£©¶¨ÆÚÍê³ÉÊý¾Ý¿âµÄÍêÈ«±¸·Ý»ò²îÒ챸·Ý¡£
2£©¶¨ÆÚÇåÀí±¸·ÝÎļþ£¬ÒòΪ´æ´¢¿Õ¼äÓÐÏÞ£¬¿ÉÄÜÖ»ÐèÒª±£´æÒ»¸öʱÆÚ¶ÎÄÚµÄÎļþ(±ÈÈçÒ»ÖÜÄÚ»òÒ»ÔÂÄÚ)¡£
¶øÈçºÎ×öµ½ÕâÁ½µãÄØ£¿±ÊÕßÏàÐÅÔÚSQL SERVER2005°æ±¾³öÀ´Ö®Ç°ÒªÊµÏÖÕâÖÖ¹¦ÄÜ£¬ Ò²ÊÇ¿ÉÒÔʵÏֵģ¬Ö»ÊÇʵÏÖ¶¨ÆÚÇåÀí±¸·ÝÎļþÏԵò»ÄÇôֱ ......

sql ÀïµÄ update ʵÏÖÁªºÏ±í¸üÐÂ

 1.update a set a.nickname=b.nickname from tab1 a,tab2 b where a.username=b.username
2.Update student_score set
student_score.level=level_about.level from
level_about where student.score
between level_about.start_score and level_about.end_score ......

SQLÊý¾Ý¿â£ºÒòΪÎļþ×é 'PRIMARY' ÒÑÂúµÄ½â¾ö·½·¨

 1.¼ì²éÄãÊÇ·ñÏÞÖÆÁËÎļþÔö³¤:  
       ÆóÒµ¹ÜÀíÆ÷--ÓÒ¼üÄãµÄÊý¾Ý¿â--ÊôÐÔ--Êý¾ÝÎļþ--¿´¿´ÓÐûÓÐÉèÖÃÎļþµÄ×î´óÖµ  
   
   2.¼ì²éÄãµÄ´ÅÅÌ·ÖÇø¸ñʽ,Èç¹û²»ÊÇNTFS·ÖÇø,Ôò»áÓÐÏÞÖÆ,½«´ÅÅÌ·ÖÇø¸ñʽ¸Ä³ÉNTFS  
 &n ......

sqlÓï¾ä ·ÃÎʲ»Í¬Êý¾Ý¿â·þÎñÆ÷ÖеÄÊý¾Ý¿â¶ÔÏóµÄ·½·¨

 ÔÚÎÒÃÇ×öÊý¾Ý¿â³ÌÐò¿ª·¢µÄʱºò£¬¾­³£»áÓöµ½ÕâÖÖÇé¿ö£ºÐèÒª½«Ò»¸öÊý¾Ý¿â·þÎñÆ÷ÖеÄÊý¾Ýµ¼Èëµ½ÁíÒ»¸öÊý¾Ý¿â·þÎñÆ÷µÄ±íÖС£Í¨³£ÎÒÃÇ»áʹÓÃÕâÖÖ·½·¨£ºÏȰÑÒ»¸öÊý¾Ý¿âÖеÄÊý¾ÝÈ¡³öÀ´·Åµ½Ä³³ö£¬È»ºóÔÙ°ÑÕâЩÊý¾ÝÒ»ÌõÌõ²åÈ뵽ĿµÄÊý¾Ý¿âÖУ¬ÕâÖÖ·½·¨Ð§Âʽϵͣ¬Ð´Æð³ÌÐòÀ´Ò²ºÜ·±Ëö£¬ÈÝÒ׳ö´í¡£ÁíÍâÒ»ÖÖ·½·¨ÊÇʹÓÃbcp»òBULK IN ......

SQLÖ®Óû§×Ô¶¨Ò庯Êý

Óû§×Ô¶¨Ò庯Êý£¨User Defined Functions£©ÊÇSQL Server µÄÊý¾Ý¿â¶ÔÏó£¬Ëü²»ÄÜÓÃÓÚÖ´ÐÐһϵÁиıäÊý¾Ý¿â״̬µÄ²Ù×÷£¬µ«Ëü¿ÉÒÔÏñϵͳº¯ÊýÒ»ÑùÔÚ²éѯ»ò´æ´¢¹ý³ÌµÈµÄ³ÌÐò¶ÎÖÐʹÓã¬Ò²¿ÉÒÔÏñ´æ´¢¹ý³ÌÒ»Ñùͨ¹ý EXECUTE ÃüÁîÀ´Ö´ÐС£Óû§×Ô¶¨Ò庯ÊýÖд洢ÁËÒ»¸öTransact-SQL Àý³Ì£¬¿ÉÒÔ·µ»ØÒ»¶¨µÄÖµ¡£
¡¡¡¡ÔÚSQL Server Öиù¾Ýº ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ