SQL ServerÖÐÁùÖÖÊý¾ÝÒƶ¯µÄ·½·¨
1.ͨ¹ý¹¤¾ßDTSµÄÉè¼ÆÆ÷½øÐе¼Èë»òµ¼³ö
DTSµÄÉè¼ÆÆ÷¹¦ÄÜÇ¿´ó£¬Ö§³Ö¶àÈÎÎñ£¬Ò²ÊÇ¿ÉÊÓ»¯½çÃ棬ÈÝÒײÙ×÷£¬µ«ÖªµÀµÄÈËÒ»°ã²»¶à£¬Èç¹ûÖ»ÊǽøÐÐSQL ServerÊý¾Ý¿âÖв¿·Ö±íµÄÒƶ¯£¬ÓÃÕâÖÖ·½·¨×îºÃ£¬µ±È»£¬Ò²¿ÉÒÔ½øÐÐÈ«²¿±íµÄÒƶ¯¡£ÔÚSQL Server Enterprise ManagerÖУ¬Õ¹¿ª·þÎñÆ÷×ó±ßµÄ+£¬Ñ¡ÔñÊý¾Ý¿â£¬ÓÒ»÷£¬Ñ¡ÔñAll tasks/Import Data...(»òAll tasks/Export Data...)£¬½øÈëÏòµ¼Ä£Ê½£¬°´Ìáʾһ²½Ò»²½×ß¾ÍÐÐÁË£¬ÀïÃæ·ÖµÃºÜϸ£¬¿ÉÒÔÁé»îµÄÔÚ²»Í¬Êý¾ÝÔ´Ö®¼ä¸´ÖÆÊý¾Ý£¬ºÜ·½±ãµÄ¡£¶øÇÒ¿ÉÒÔÁí´æ³ÉDTS°ü£¬Èç¹ûÒÔºó»¹ÓÐÏàͬµÄ¸´ÖÆÈÎÎñ£¬Ö±½ÓÔËÐÐDTS°ü¾ÍÐУ¬Ê¡Ê±Ê¡Á¦¡£Ò²¿ÉÒÔÖ±½Ó´ò¿ªDTSÉè¼ÆÆ÷£¬·½·¨ÊÇÕ¹¿ª·þÎñÆ÷Ãû³ÆÏÂÃæµÄData Transformation Services£¬Ñ¡Local Packages£¬ÔÚÓұߵĴ°¿ÚÖÐÓÒ»÷£¬Ñ¡New Package£¬¾Í´ò¿ªÁËDTSÉè¼ÆÆ÷¡£ÖµµÃ×¢ÒâµÄÊÇ:Èç¹ûÔ´Êý¾Ý¿âÒª¿½±´µÄ±íÓÐÍâ¼ü£¬×¢ÒâÒƶ¯µÄ˳Ðò£¬ÓÐʱҪ·ÖÅúÒƶ¯£¬·ñÔòÍâ¼üÖ÷¼ü£¬Ë÷Òý¿ÉÄܶªÊ§£¬Òƶ¯µÄʱºòÑ¡ÏîÅԱߵÄÌáʾ˵µÄºÜÃ÷°×£¬»òÕßÒ»´ÎÐԵĸ´ÖƵ½Ä¿±êÊý¾Ý¿âÖУ¬ÔÙÖØн¨Á¢Íâ¼ü£¬Ö÷¼ü£¬Ë÷Òý¡£
Æäʵ½¨Á¢Êý¾Ý¿âʱ£¬½¨Á¢Íâ¼ü£¬Ö÷¼ü£¬Ë÷ÒýµÄÎļþÓ¦¸ÃºÍ½¨±íÎļþ·Ö¿ª£¬¶øÇÒÓõÄÊý¾ÝÎļþÒ²·Ö¿ª£¬²¢·Ö±ð·ÅÔÚ²»Í¬µÄÇý¶¯Æ÷ÉÏ£¬ÓÐÀûÓÚÊý¾Ý¿âµÄÓÅ»¯¡£
2. ÀûÓÃBcp¹¤¾ß
ÕâÖÖ¹¤¾ßËäÈ»ÔÚSQL Server7µÄ°æ±¾Öв»ÍƼöʹÓ㬵«Ðí¶àÊý¾Ý¿â¹ÜÀíÔ±ÈÔºÜϲ»¶ÓÃËü£¬ÓÈÆäÊÇÓùýSQL ServerÔçÆÚ°æ±¾µÄÈË¡£BcpÓоÖÏÞÐÔ£¬Ê×ÏÈËüµÄ½çÃæ²»ÊÇͼÐλ¯µÄ£¬Æä´ÎËüÖ»ÊÇÔÚSQL ServerµÄ±í(ÊÓͼ)ÓëÎı¾ÎļþÖ®¼ä½øÐи´ÖÆ£¬µ«ËüµÄÓŵãÊÇÐÔÄܺ㬿ªÏúС£¬Õ¼ÓÃÄÚ´æÉÙ£¬Ëٶȿ졣ÓÐÐËȤµÄÅóÓÑ¿ÉÒÔ²é²Î¿¼Êֲᡣ
3. ÀûÓñ¸·ÝºÍ»Ö¸´
ÏȶÔÔ´Êý¾Ý¿â½øÐÐÍêÈ«±¸·Ý£¬±¸·Ýµ½Ò»¸öÉ豸(device)ÉÏ£¬È»ºó°Ñ±¸·ÝÎļþ¸´ÖƵ½Ä¿µÄ·þÎñÆ÷ÉÏ(»Ö¸´µÄËٶȿì)£¬½øÐÐÊý¾Ý¿âµÄ»Ö¸´²Ù×÷£¬ÔÚ»Ö¸´µÄÊý¾Ý¿âÃûÖÐÌîÉÏÔ´Êý¾Ý¿âµÄÃû×Ö(Ãû×Ö±ØÐëÏàͬ)£¬Ñ¡ÔñÇ¿ÖÆÐͻָ´(¿ÉÒÔ¸²¸ÇÒÔÇ°Êý¾Ý¿âµÄÑ¡Ïî)£¬ÔÚÑ¡Ôñ´ÓÉ豸ÖнøÐлָ´£¬ä¯ÀÀʱѡÖб¸·ÝµÄÎļþ¾ÍÐÐÁË¡£ÕâÖÖ·½·¨¿ÉÒÔÍêÈ«»Ö¸´Êý¾Ý¿â£¬°üÀ¨Íâ¼ü£¬Ö÷¼ü£¬Ë÷Òý¡£
4. Ö±½Ó¿½±´Êý¾ÝÎļþ
°ÑÊý¾Ý¿âµÄÊý¾ÝÎļþ(*.mdf)ºÍÈÕÖ¾Îļþ(*.ldf)¶¼¿½±´µ½Ä¿µÄ·þÎñÆ÷£¬ÔÚSQL Server Query AnalyzerÖÐÓÃÓï¾ä½øÐлָ´:
EXEC sp_attach_db @dbname = ’test’,
@filename1 = ’d:mssql7data est_data.mdf’,
@filename2 = ’d:mssql7data est_log.ldf’
ÕâÑù¾Í°ÑtestÊý¾Ý¿â¸½¼Óµ½SQL ServerÖУ¬¿ÉÒÔÕÕ³£Ê¹Óá£Èç¹û
Ïà¹ØÎĵµ£º
ʹÓÃSQL Serverµ¼Èë/µ¼³öExcel,°üº¬²¿·Ö´íÎóÐÅÏ¢´¦Àí·½·¨;
²Ù×÷ÊÖ¼Ç,Áô´Ë±¸²é
/*
µ¼Èë
*/
--´íÎóÐÅÏ¢ÈçÏÂʱ£º
--Msg 15281, Level 16, State 1, Line 2
--SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as ......
×òÌì½âÎöÁËdblp.xml£¬´æÈëÊý¾Ý¿â£¬Éú³ÉÁËÈô¸ÉÕÅÁÙʱ±í¡£½ñÌìÉÏÎ磬¶ÔÕâЩÁÙʱ±í½øÐд¦Àí£¬È»ºó´æÈëʵÑéÉè¼ÆµÄ±íÖС£Êý¾Ý¿âµÄÊý¾ÝÁ¿±È½Ï´ó£¬50¶àM£¬80¶àÍòÌõ¼Ç¼¡£Òò¶øÖ´ÐÐsqlʱ£¬¾ÍÓöµ½Á˺ܶàÎÊÌâ¡£
1¡¢È¥³ýÖظ´tuple
Ôʼdblp.xmlÖУ¬Í¬Ò»ÂÛÎĵĴæÔÚ¼¸¸öÍêÈ«ÏàͬµÄ&l ......
×î½üÓõ½ÈÕÆÚ·¶Î§µÄ²éѯ£¬Óõ½ÁËbetween£¬µ«ÊÇ·¢ÏÖÈç¹ûÈÕÆÚ´øʱ¼äµÄ»°£¬BETWEEN '2010-1-4' AND
'2010-1-4'ÕâÑùµÄÓï¾äÊDz鲻µ½Êý¾ÝµÄ£¬ºóÀ´Ïëµ½ÁËÒ»ÖָĽø·½·¨£¬¹©´ó¼Ò²Î¿¼¡£
ÈçÏ£º
BETWEEN '2010-1-4' AND DATEADD(day, 1, '2010-1-4')
ÓÃÁËDATEADDÒÔºó£¬Ð§¹ûºÜ²»´í ......
Ò»¡¢ÅäÖà SQL Server£¬Ê¹Ö®ÔÊÐí CLR ¼¯³É:
¡¡¡¡1.µ¥»÷“¿ªÊ¼”°´Å¥£¬ÒÀ´ÎÖ¸Ïò“ËùÓгÌÐò”¡¢Microsoft SQL Server 2005 ºÍ“ÅäÖù¤¾ß”£¬È»ºóµ¥»÷“ÍâΧӦÓÃÅäÖÃÆ÷”¡£
¡¡¡¡2.ÔÚ SQL Server 2005 ÍâΧӦÓÃÅäÖÃÆ÷¹¤¾ßÖУ¬µ¥»÷“¹¦ÄܵÄÍâΧӦÓÃÅäÖÃÆ÷”¡£
¡¡¡¡3.Ñ¡ÔñÄ ......
¶ÔͬһÕűí½øÐÐÁ½ÖÖ·½Ê½²éѯ£¨½á¹û¼¯Ïàͬ£©£º
case1 ²éѯÌõ¼þ:°üÀ¨¼ÆËã»úÃû£¬êdzƣ¬Ìí¼Óʱ¼äµÈµÈһЩÏÞÖÆÌõ¼þ×ֶΡ£¶øÇÒÐèÁª±í²éѯ±ðµÄ±í
²éѯÊý¾ÝÁ¿£º 100Íò 200Íò
µ¥´¿Ö´ÐÐSQLÓï¾äËùÐèʱ¼ä£º31ºÁÃë&nbs ......