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

SQlÖÐSTUFFÓ÷¨

1¡¢×÷ÓÃ
     ɾ³ýÖ¸¶¨³¤¶ÈµÄ×Ö·û£¬²¢ÔÚÖ¸¶¨µÄÆðµã´¦²åÈëÁíÒ»×é×Ö·û¡£
2¡¢Óï·¨
     STUFF ( character_expression , start , length ,character_expression )
3¡¢Ê¾Àý
     ÒÔÏÂʾÀýÔÚµÚÒ»¸ö×Ö·û´® abcdÖÐɾ³ý´ÓµÚ 2 ¸öλÖã¨×Ö·û b£©¿ªÊ¼µÄÈý¸ö×Ö·û£¬È»ºóÔÚɾ³ýµÄÆðʼλÖòåÈëµÚ¶þ¸ö×Ö·û´®£¬´Ó¶ø´´½¨   ²¢·µ»ØÒ»¸ö×Ö·û´®
     SELECT STUFF('abcde', 2, 3, 'fgh')
     GO
     ÏÂÃæÊǽá¹û¼¯
     afghe
4¡¢²ÎÊý
     character_expression
     Ò»¸ö×Ö·ûÊý¾Ý±í´ïʽ¡£character_expression ¿ÉÒÔÊdz£Á¿¡¢±äÁ¿£¬Ò²¿ÉÒÔÊÇ×Ö·ûÁлò¶þ½øÖÆÊý¾ÝÁС£
     start
     Ò»¸öÕûÊýÖµ£¬Ö¸¶¨É¾³ýºÍ²åÈëµÄ¿ªÊ¼Î»Öá£Èç¹û start »ò length Ϊ¸º£¬Ôò·µ»Ø¿Õ×Ö·û´®¡£Èç¹û start ±ÈµÚÒ»¸öcharacter_expression³¤£¬Ôò·µ»Ø¿Õ×Ö·û´®¡£start ¿ÉÒÔÊÇ bigint ÀàÐÍ¡£
     length
     Ò»¸öÕûÊý£¬Ö¸¶¨ÒªÉ¾³ýµÄ×Ö·ûÊý¡£Èç¹û length ±ÈµÚÒ»¸ö character_expression³¤£¬Ôò×î¶àɾ³ýµ½×îºóÒ»¸ö     character_expression ÖеÄ×îºóÒ»¸ö×Ö·û¡£length ¿ÉÒÔÊÇ bigint ÀàÐÍ¡£
5¡¢·µ»ØÀàÐÍ
     Èç¹û character_expression ÊÇÊÜÖ§³ÖµÄ×Ö·ûÊý¾ÝÀàÐÍ£¬Ôò·µ»Ø×Ö·ûÊý¾Ý¡£Èç¹û character_expression ÊÇÒ»¸öÊÜÖ§³ÖµÄ binary Êý¾ÝÀàÐÍ£¬Ôò·µ»Ø¶þ½øÖÆÊý¾Ý¡£
6¡¢±¸×¢
     Èç¹û½á¹ûÖµ´óÓÚ·µ»ØÀàÐÍÖ§³ÖµÄ×î´óÖµ£¬Ôò²úÉú´íÎó¡£


Ïà¹ØÎĵµ£º

sqlµÄjoin

¶ÔÓÚÎÒÃÇÕâЩ½öÓõ½sql¼òµ¥²éѯ¿ª·¢ÈËÔ±À´Ëµ£¬¿ÉÄÜÖ»Á˽âһЩ»ù±¾µÄsqlº¯ÊýºÍ<>=ÕâÑùµÄÌõ¼þÓï¾ä£¬½ñÌìÒ»¸öÅóÓÑÎÊÆð£ºÄ¬ÈϵÄjoinÊÇouter»¹ÊÇinner¡£¡£¡£¡£
ÌصØÊÕ¼¯ÁËһЩ¶«Î÷£¬Ò²Ìù³öÀ´ºÍ´ó¼Ò·ÖÏíÏ£º
joinleft outer join=left join ,   right outer join=right join,     inner jo ......

SQL Server 2005 Á¬½Ó×Ö·û´®´úÂë


SQL Native Client ODBC Driver
±ê×¼°²È«Á¬½Ó
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
ÄúÊÇ·ñÔÚʹÓÃSQL Server 2005 Express ÇëÔÚ“Server”Ñ¡ÏîʹÓÃÁ¬½Ó±í´ïʽ“Ö÷»úÃû³Æ\SQLEXPRESS”¡£
ÊÜÐŵÄÁ¬½Ó
Driver={SQL Native ......

Êý¾Ý¿â»ù±¾ SQLÓï¾ä´óÈ«

Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
Create DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database dbname
3¡¢ËµÃ÷£º±¸·Ýsql server
--- ´´½¨ ±¸·ÝÊý¾ÝµÄ device
USE master
EXEC sp_addumpdevice disk, testBack, c:mssql7backupMyNwind_1.dat
--- ¿ªÊ¼ ±¸·Ý
BACKUP DATABASE pubs TO testBack
4¡¢Ë ......

ʹÓÃXMLÔÚSQL ServerÉÏ´´½¨¼ÆËãÁÐ

¡¡ÔÚSQL ServerÊý¾Ý¿âÖУ¬µ±ÄãÏëʹÓÃÒ»¸öÊý¾Ý£¬¶øÕâ¸öÊý¾Ý²»±£´æÔÚ±íÖУ¬¼ÆËãÁкÜÓÐÓá£ÀýÈ磬ÄãÓÐÒ»ÕÅ±í£¬Ëü°üÀ¨ÁÐdollar amounts, wholesale pricesºÍretail prices¡£Äã¿Ï¶¨²»ÏëÔÚÿ´Î²éѯ±íʱÀ´¼ÆËãÄÇÁ½ÁÐÖ®¼äµÄ²îÖµ£¬ÄãÏ£Íû½«ÆäÖµ±£´æÔÚµÚÈýÁÐÖУ¬ÈÃÆä×Ô¶¯¼ÆËãÇ°Á½ÁÐÖ®¼äµÄ²îÖµ¡£¶ø´ËÁоÍÊǼÆËãÁС£
¡¡¡¡ÔÚSQL ServerÖ ......

SQL ServerÔË×÷µÄ¼ò¶Ì¿Î³Ì

Ãæ¶ÔÏÖʵ°É£¬ËäÈ»Äã´ÓÀ´Ã»ÓдòËã³ÉΪһÃûSQL Serverר¼Ò£¬µ«ÊÇËæ×ÅÊý¾Ý¿âÒýÇæÖÖÀàºÍ°æ±¾µÄÔö¼Ó£¬Õâ¾ÍÒªÇóһЩÈËÀ´×¨ÃÅ´Óʲ¢¹Ø×¢Õâ·½ÃæµÄÄÚÈÝ¡£×÷Ϊ“΢ÈíÈË”(»òÕß³ÆΪGal),ÎÞÂÛÄãÊDz»ÊÇÔ¸Ò⣬Ä㶼±»Ñ¡ÖÐÁË¡£ÕâһϵÁеÄÎÄÕÂÈ«¶¼ÊǹØÓÚ°ïÖú×÷Ϊ¹ÜÀíÔ±¶ø·Ç³ÌÐòÔ±µÄÄãÔÚʹÓÃSQL Serverʱ¸ü¼Ó¸ßЧ¡£
¡¡¡¡ÔÚʵ¼ÊÖ´ÐÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ