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

½ÌÄãÔÚSQL ServerÊý¾Ý¿âÖÐÉè¼Æ±íºÍ×Ö¶Î

ת×Ô£ºhttp://news.newhua.com/news1/program_database/2008/530/0853092638H5D5AAC4I06BI1G22DCAH8H8B7HIGB0G3F109J6E7F9K2_2.html?lt=common
1. ԭʼµ¥¾ÝÓëʵÌåÖ®¼äµÄ¹Øϵ
¿ÉÒÔÊÇÒ»¶ÔÒ»¡¢Ò»¶Ô¶à¡¢¶à¶Ô¶àµÄ¹Øϵ¡£ÔÚÒ»°ãÇé¿öÏ£¬ËüÃÇÊÇÒ»¶ÔÒ»µÄ¹Øϵ£º¼´Ò»ÕÅԭʼµ¥¾Ý¶ÔÓ¦ÇÒÖ»¶ÔÓ¦Ò»¸öʵÌå¡£ÔÚÌØÊâÇé¿öÏ£¬ËüÃÇ¿ÉÄÜÊÇÒ»¶Ô¶à»ò¶à¶ÔÒ»µÄ¹Øϵ£¬¼´Ò»ÕÅԭʼµ¥Ö¤¶ÔÓ¦¶à¸öʵÌ壬»ò¶àÕÅԭʼµ¥Ö¤¶ÔÓ¦Ò»¸öʵÌå¡£ÕâÀïµÄʵÌå¿ÉÒÔÀí½âΪ»ù±¾±í¡£Ã÷È·ÕâÖÖ¶ÔÓ¦¹Øϵºó£¬¶ÔÎÒÃÇÉè¼Æ¼Èë½çÃæ´óÓкô¦¡£
¡¾Àý1¡¿£ºÒ»·ÝÔ±¹¤ÂÄÀú×ÊÁÏ£¬ÔÚÈËÁ¦×ÊÔ´ÐÅϢϵͳÖУ¬¾Í¶ÔÓ¦Èý¸ö»ù±¾±í£ºÔ±¹¤»ù±¾Çé¿ö±í¡¢Éç»á¹Øϵ±í¡¢¹¤×÷¼òÀú±í¡£Õâ¾ÍÊÇ“Ò»ÕÅԭʼµ¥Ö¤¶ÔÓ¦¶à¸öʵÌ唵ĵäÐÍÀý×Ó¡£
 
2. Ö÷¼üÓëÍâ¼ü
Ò»°ã¶øÑÔ£¬Ò»¸öʵÌå²»ÄܼÈÎÞÖ÷¼üÓÖÎÞÍâ¼ü¡£ÔÚE—R ͼÖÐ, ´¦ÓÚÒ¶×Ó²¿Î»µÄʵÌå, ¿ÉÒÔ¶¨ÒåÖ÷¼ü£¬Ò²¿ÉÒÔ²»¶¨ÒåÖ÷¼ü(ÒòΪËüÎÞ×ÓËï), µ«±ØÐëÒªÓÐÍâ¼ü(ÒòΪËüÓи¸Ç×)¡£
Ö÷¼üÓëÍâ¼üµÄÉè¼Æ£¬ÔÚÈ«¾ÖÊý¾Ý¿âµÄÉè¼ÆÖУ¬Õ¼ÓÐÖØÒªµØλ¡£µ±È«¾ÖÊý¾Ý¿âµÄÉè¼ÆÍê³ÉÒÔºó£¬ÓиöÃÀ¹úÊý¾Ý¿âÉè¼Æר¼Ò˵£º“¼ü£¬µ½´¦¶¼ÊǼü£¬³ýÁ˼üÖ®Í⣬ʲôҲûÓД£¬Õâ¾ÍÊÇËûµÄÊý¾Ý¿âÉè¼Æ¾­Ñé̸֮£¬Ò²·´Ó³ÁËËû¶ÔÐÅϢϵͳºËÐÄ(Êý¾ÝÄ£ÐÍ)µÄ¸ß¶È³éÏó˼Ïë¡£ÒòΪ£ºÖ÷¼üÊÇʵÌåµÄ¸ß¶È³éÏó£¬Ö÷¼üÓëÍâ¼üµÄÅä¶Ô£¬±íʾʵÌåÖ®¼äµÄÁ¬½Ó¡£
 
3. »ù±¾±íµÄÐÔÖÊ
»ù±¾±íÓëÖмä±í¡¢ÁÙʱ±í²»Í¬£¬ÒòΪËü¾ßÓÐÈçÏÂËĸöÌØÐÔ£º
(1) Ô­×ÓÐÔ¡£»ù±¾±íÖеÄ×Ö¶ÎÊDz»¿ÉÔÙ·Ö½âµÄ¡£
(2) ԭʼÐÔ¡£»ù±¾±íÖеļǼÊÇԭʼÊý¾Ý£¨»ù´¡Êý¾Ý£©µÄ¼Ç¼¡£
(3) ÑÝÒïÐÔ¡£ÓÉ»ù±¾±íÓë´úÂë±íÖеÄÊý¾Ý£¬¿ÉÒÔÅÉÉú³öËùÓеÄÊä³öÊý¾Ý¡£
(4) Îȶ¨ÐÔ¡£»ù±¾±íµÄ½á¹¹ÊÇÏà¶ÔÎȶ¨µÄ£¬±íÖеļǼÊÇÒª³¤ÆÚ±£´æµÄ¡£
Àí½â»ù±¾±íµÄÐÔÖʺó£¬ÔÚÉè¼ÆÊý¾Ý¿âʱ£¬¾ÍÄܽ«»ù±¾±íÓëÖмä±í¡¢ÁÙʱ±íÇø·Ö¿ªÀ´¡£
 
4. ·¶Ê½±ê×¼
»ù±¾±í¼°Æä×Ö¶ÎÖ®¼äµÄ¹Øϵ, Ó¦¾¡Á¿Âú×ãµÚÈý·¶Ê½¡£µ«ÊÇ£¬Âú×ãµÚÈý·¶Ê½µÄÊý¾Ý¿âÉè¼Æ£¬ÍùÍù²»ÊÇ×îºÃµÄÉè¼Æ¡£ÎªÁËÌá¸ßÊý¾Ý¿âµÄÔËÐÐЧÂÊ£¬³£³£ÐèÒª½µµÍ·¶Ê½±ê×¼£ºÊʵ±Ôö¼ÓÈßÓ࣬´ïµ½ÒԿռ任ʱ¼äµÄÄ¿µÄ¡£
¡¾Àý2¡¿£ºÓÐÒ»ÕÅ´æ·ÅÉÌÆ·µÄ»ù±¾±í£¬Èç±í1Ëùʾ¡£“½ð¶î”Õâ¸ö×ֶεĴæÔÚ£¬±íÃ÷¸Ã±íµÄÉè¼Æ²»Âú×ãµÚÈý·¶Ê½£¬ÒòΪ“½ð¶î”¿ÉÒÔÓÉ“µ¥¼Û”³ËÒÔ“ÊýÁ¿”µÃµ½£¬ËµÃ÷“½ð¶î”ÊÇÈßÓà×ֶΡ£µ«ÊÇ£¬Ôö¼Ó“½ð¶î”Õâ¸öÈßÓà×ֶΣ¬¿ÉÒÔÌá¸ß²éѯͳ¼ÆµÄËٶȣ¬Õâ¾


Ïà¹ØÎĵµ£º

º½¿Õ¹«Ë¾¹ÜÀíϵͳ(VC++ ÓëSQL 2005)

ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
      ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......

sql choch02

ch02
--3-4
select * from orders
where 'México D.F.' in
(select City
from Customers
where Orders.CustomerID = Customers.CustomerID )
--3-5
select * from orders
where 'usa' =
(select Country
from Customers
where Orders.CustomerID = Customers.CustomerID )
--4-1
select * from or ......

SQL Server Óï¾ä

1.SELECTÓï¾ä´ÓÊý¾Ý¿âÖÐÑ¡È¡Êý¾Ý
SELECT 'ÁÐÃû' from '±íÃû' SELECT list_name from table_name ´Ó '±íÃû' Ñ¡Çø'ÁÐÃû' Êý¾Ý SQL SELECT * from table_name ´Ó '±íÃû' Ñ¡ÇøÈ«²¿Êý¾Ý
2.SELECT ¼ÓWHERE Óï¾ä
SELECT 'ÁÐÃû' from '±íÃû' WHERE 'Ìõ¼þ'
3.SELECT ¼ÓAS Óï¾ä
ʹÓÃAS ¸øÊý¾ÝÖ¸¶¨Ò»¸ö±ðÃû¡£´Ë±ðÃûÓÃÀ´ÔÚ±í´ïʽ ......

SQL Server 2005 Êý¾Ýµ¼Èëµ¼³ö¹¤¾ßBCPÏê½â

bcpÊÇSQL ServerÖиºÔðµ¼Èëµ¼³öÊý¾ÝµÄÒ»¸öÃüÁîÐй¤¾ß£¬ËüÊÇ»ùÓÚDB-LibraryµÄ£¬²¢ÇÒÄÜÒÔ²¢Ðеķ½Ê½¸ßЧµØµ¼Èëµ¼³ö´óÅúÁ¿µÄÊý¾Ý¡£bcp¿ÉÒÔ½«Êý¾Ý¿âµÄ±í»òÊÓͼֱ½Óµ¼³ö£¬Ò²ÄÜͨ¹ýSELECT fromÓï¾ä¶Ô±í»òÊÓͼ½øÐйýÂ˺󵼳ö¡£ÔÚµ¼Èëµ¼³öÊý¾Ýʱ£¬¿ÉÒÔʹÓÃĬÈÏÖµ»òÊÇʹÓÃÒ»¸ö¸ñʽÎļþ½«ÎļþÖеÄÊý¾Ýµ¼Èëµ½Êý¾Ý¿â»ò½«Êý¾Ý¿âÖеÄÊý¾Ýµ ......

Åú´¦ÀíSQL Îļþ

@echo off
rem Input Parameters:
rem 1 -Server Name
rem 2 -Database Name
if "%1"=="" goto ERROR
if "%2"=="" goto ERROR
@rem Make variables local
@Setlocal
@rem set variables from input parameters
set Server=% 1
set DBName=% 2
@rem------------------------------------------------------------ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ