SQL Server 2008¼¸ÏîÐÂÌØÐÔ¸ÅÊö
¼Æ»®ÓÚ2008ÄêµÚÒ»¼¾¶È·¢²¼µÄSQL Server 2008²»½ö¶ÔÔÓÐÐÔÄܽøÐÐÁ˸Ľø£¬»¹Ìí¼ÓÁËÐí¶àÐÂÌØÐÔ£¬±ÈÈçÐÂÌíÁËÊý¾Ý¼¯³É¹¦ÄÜ£¬¸Ä½øÁË·ÖÎö·þÎñ£¬±¨¸æ·þÎñ£¬ÒÔ¼°Office¼¯³ÉµÈµÈ¡£
¡¡¡¡SQL Server¼¯³É·þÎñ
¡¡¡¡SSIS(SQL Server¼¯³É·þÎñ)ÊÇÒ»¸öǶÈëʽӦÓóÌÐò£¬ÓÃÓÚ¿ª·¢ºÍÖ´ÐÐETL(½âѹËõ¡¢×ª»»ºÍ¼ÓÔØ)°ü¡£SSIS´úÌæÁËSQL 2000µÄDTS¡£ÕûºÏ·þÎñ¹¦ÄܼȰüº¬ÁËʵÏÖ¼òµ¥µÄµ¼Èëµ¼³ö°üËù±ØÐèµÄWizardµ¼Ïò²å¼þ¡¢¹¤¾ßÒÔ¼°ÈÎÎñ£¬Ò²Óзdz£¸´ÔÓµÄÊý¾ÝÇåÀí¹¦ÄÜ¡£SQL Server 2008 SSISµÄ¹¦ÄÜÓкܴóµÄ¸Ä½øºÍÔöÇ¿£¬±ÈÈçËüµÄÖ´ÐгÌÐòÄܹ»¸üºÃµØ²¢ÐÐÖ´ÐС£ÔÚSSIS 2005£¬Êý¾Ý¹ÜµÀ²»ÄÜ¿çÔ½Á½¸ö´¦ÀíÆ÷¡£¶øSSIS 2008Äܹ»ÔڶദÀíÆ÷»úÆ÷ÉÏ¿çÔ½Á½¸ö´¦ÀíÆ÷ ¡£¶øÇÒËüÔÚ´¦Àí´ó¼þ°üÉÏÃæµÄÐÔÄܵõ½ÁËÌá¸ß¡£SSISÒýÇæ¸ü¼ÓÎȶ¨£¬ËøËÀÂʸüµÍ¡£
¡¡¡¡Lookup¹¦ÄÜÒ²µÃµ½Á˸Ľø¡£LookupÊÇSSISÒ»¸ö³£ÓõĻñÈ¡Ïà¹ØÐÅÏ¢µÄ¹¦ÄÜ¡£±ÈÈç´ÓCustomerID²éÕÒCustomer Name£¬»ñÈ¡Êý¾Ý¼¯¡£LookupÔÚSSISÖкܳ£¼û£¬¶øÇÒ¿ÉÒÔ´¦ÀíÉÏ°ÙÍòÐеÄÊý¾Ý¼¯£¬Òò´ËÐÔÄÜ¿ÉÄܺܲSQL 2008¶ÔLookupµÄÐÔÄÜ×÷³öºÜ´óµÄ¸Ä½ø£¬¶øÇÒÄܹ»´¦Àí²»Í¬µÄÊý¾ÝÔ´£¬°üÀ¨ ADO.NET£¬XML£¬OLEDBºÍÆäËûSSISѹËõ°ü¡£
¡¡¡¡SQL 2008¿ÉÒÔÖ´ÐÐTSQLµÄMERGEÃüÁî¡£ÓÃMERGEÃüÁֻÐèÒ»¸öÓï¾ä¾Í¿ÉÒÔ¶ÔÐнøÐÐ UPDATE¡¢INSERT»ò DELETE¡£ÏÂÃæµÄÀý×Ó¾ÍÊÇÈçºÎÓÃMERGEÃüÁîÀ´°ÑеÄInventory Item descriptions Áбí²åÈëÒÑÓеÄInventory MasterÖС£³ýÁË descriptions£¬ NewInventory±í¸ñÖл¹¼ÓÈëÁËÆäËûһЩ²¿·Ö¡£Èç¹ûûÓÐMERGEÓï¾ä£¬¾ÍÐèÒªÖ´ÐÐÁ½¸öÃüÁî²ÅÄÜÍê³É¡£µÚÒ»¸öÃüÁî²éÕÒÆ¥ÅäµÄDescriptionÈ»ºó¸üС£µÚ¶þ¸öÃüÁî²éÕÒ²»Æ¥ÅäÏîÈ»ºó²åÈë¡£ÓÐÁËMERGE£¬Ò»¸öÓï¾ä¾Í¿ÉÒÔÍê³ÉÕâÁ½¸öÈÎÎñ¡£²½ÖèÈçÏ£º
¡¡¡¡MERGE InventoryMaster AS im
¡¡¡¡USING (SELECT InventoryID, Descr from NewInventory) AS src
¡¡¡¡ON im. InventoryID = src. InventoryID
¡¡¡¡WHEN MATCHED THEN
¡¡¡¡UPDATE SET im.Descr = src.Descr
¡¡¡¡WHEN NOT MATCHED THEN
¡¡¡¡INSERT (InventoryID, Descr) VALUES (src. InventoryID, src.Descr);
¡¡¡¡·ÖÎö·þÎñ
¡¡¡¡SSAS(SQL Server·ÖÎö·þÎñ)Ò²µÃµ½Á˺ܴ
Ïà¹ØÎĵµ£º
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import xml.dao.admin.AdminArea;
public class NativeSQLQuery extends HibernateDaoSupport {
......
ÔÚÐÔÄÜÉÏ£¬mysqlÊÇÏ൱³öÉ«µÄ£¬×ÀÃæ¸ñʽmyisamÊý¾Ý¿âÓë´ÅÅ̷dz£µØ¼æÈݶø²»Õ¼Óùý¶àµÄcpuºÍÄڴ棬mysqlÄÚ²¿ºÜ¶àʱºò¶¼Ê¹ÓÃ64λÕûÊý´¦Àí¡£yahoo¾ÍʹÓÃmysqlºǫ́Êý¾Ý¿â¡£
µ«mysqlȱÉÙһЩ¸½¼Ó¹¦ÄÜ£¬Ã»ÓÐSqlServerÈ«Ãæ¡£
sqlserverÎȶ¨ÐÍÇ¿£¬µ«±ØÐëÔö¼Ó¶îÍ⸴ÔÓ²Ù×÷£¬´ÅÅÌ´æ´¢£¬ÄÚ´æËðºÄµÈ£¬¶ÔÓ²¼þÈí¼þÒªÇ󶼺ܸߡ£
ÕâÁ½¸öÊý ......
ÉÏÒ»½Ú½²ÊöµÄÊÇɾ³ý²Ù×÷£¬±¾½Ú½«½²ÊöÈçºÎÖ±½ÓÖ´ÐÐsqlÓï¾ä¡£ Ö±½ÓÖ´ÐÐsqlÓï¾äÊÇʹÓÃfromSql·½·¨¡£ DbSession.Default.fromSql("select * from products").ToDataTable();
ÕâÑù¿´ÆðÀ´Ç×ÇжàÁË°É£¬Ö±½Ósql¾Í¿ÉÒÔÖ´ÐС£
µ±È»Ò²¿ÉÌí¼Ó²ÎÊýµÄ°¡¡£
DbSession.Default.fromSql("select * ......
declare @a int
set @a = 1
while @a<1000000
begin
insert into Test(name) values(@a)
set @a = @a + 1
end ......