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

ASPÖÐʹÓÃSQLServerµÄÊÂÎñ¿ØÖƼ°ÅúÖ´ÐÐSqlÓï¾ä

<%
   SQL1 = "update table1 set a=b where id=1"
   Conn.ExeCute SQL1
    SQL2 = "update table2 set a=b where id=2"
   Conn.ExeCute SQL2
   SQL3 = "update table3 set a=b where id=3"
   Conn.ExeCute SQL3
%>
    ÊÂʵÉÏ£¬ÕâÊÇÒ»ÖÖЧÂʺܵÍϵÄд·¨£¬ÎªÁËÌá¸ßSQLµÄÖ´ÐÐЧÂÊ£¬ÎÒÃÇ¿ÉÒ԰Ѷà¸öSQLÓï¾äÓ÷ֺÅÆ´½ÓÔÚÒ»Æð£¬È»ºóÒ»´ÎÐÔ½»¸øConnÀ´Ö´ÐС£ÈçÏ£º
<%   
    SQL1 = "update table1 set a=b where id=1"
    SQL2 = "update table2 set a=b where id=2"
    SQL3 = "update table3 set a=b where id=3"
    SQL = SQL1 & ";" & SQL2 & ";" & SQL3
    Conn.ExeCute SQL
%>
    µ«ÊÇ£¬ÒÔÉÏ2ÖÖд·¨¶¼»áÃæÁÙÒ»¸öÎÊÌ⣬¾ÍÊǵ±ÎÒÃÇÐèÒª±£Ö¤3ÌõSQLÓï¾ä¶¼±ØÐëÍêÕûÖ´ÐУ¬µ±Ä³Ò»ÌõÖ´ÐдíÎóʱ£¬ÆäËû2ÌõÒ²¸úׯعöʱ£¬ÎÒÃǾÍÐèÒªÓõ½SQLServerµÄÊÂÎñ¿ØÖÆÁË£¬²»ÉÙµÄÎÄÕ½¨ÒéʹÓÃÒÔÏ·½·¨£º
<%
dim Conn=Server.CreateObject("ADODB.Connection")  
'¿ªÊ¼ÊÂÎñ  
Conn.BeginTrans    
'Ö´ÐÐSQL,Èô³É¹¦ÔòÌύʣ¬·ñÔò»Ø¹öÊÂÎñ  
Conn.Execute(sqlÓï¾ä)  
'Ìá½»ÊÂÎñ  
Conn.CommitTrans  
'»Ø¹öÊÂÎñ  
Conn.RollbackTrans
%>
    Ôںܶàʱºò£¬Õâ²¢²»ÄÜ´ïµ½±£Ö¤SQLÓï¾äÍêÕûÖ´ÐеÄÄ¿µÄ£¬¸ßЧµÄ×ö·¨Ó¦¸ÃÊÇÀûÓÃSQLServer±¾ÉíµÄÊÂÎñ¿ØÖƹ¦ÄÜ£¬ÈçÏ£º
<%
Sub ExeSql(byval SqlStr)
Dim TrSql
TrSql = "SET XACT_ABORT ON;BEGIN TRANSACTION;"
   TrSql = TrSql & SqlStr
   TrSql = TrSql & ";COMMIT TRANSACTION;SET XACT_ABORT OFF"
Conn.ExeCute(TrSql)
End Sub
SQL1 = "update table1 set a=b where id=1"
SQL2 = "update table2 set a=b where id=2"
SQL3 = "update table3 set a=b where id=3"
SQL = SQL1 & ";" & SQL2 & ";" & SQL3
ExeSql SQL
%>


Ïà¹ØÎĵµ£º

SQLSERVER SQLÐÔÄÜÓÅ»¯

1.Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)¡¡¡¡
¡¡¡¡ SQLSERVERµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬Òò´Ëfrom×Ó¾äÖÐдÔÚ×îºóµÄ±í£¨»ù´¡±ídriving table£©½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏ£¬±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í£¬µ±SQLSERVER´¦Àí¶à¸ö±íʱ£¬»áÔËÓÃÅÅÐò¼°ºÏ²¢µÄ·½Ê½Á ......

¹ØÓÚoracleµ¼Èësqlserver´æÔÚµÄΨһË÷ÒýÎÊÌâ

ÎÒÔÚ°ÑoracleÊý¾Ýµ¼ÈësqlserverÖÐʱ£¬·¢ÏÖÔÚoracleÖÐ×ֶζ¨ÒåΪΨһË÷Òýʱ£¬²»Í¬¼Ç¼µÄ´Ë×Ö¶ÎÈç¹ûΪ¿Õ²»±»ÈÏΪÊÇÖظ´µÄ£¬µ«ÔÚsqlserverÖÐÈç¹û´Ë×Ö¶ÎΪΨһË÷Òý×ֶΣ¬²»ÔÊÐíÓÐ2¸öÒÔÉϵĿÕÖµ¡£ÓôÃÆ¡£ËùÒÔÖ»ºÃ½«sqlserverÖеÄΨһË÷Òý×Ö¶ÎÊÖ¹¤ÐÞ¸ÄΪ¼¸¸ö·Ç¿ÕµÄÖµ£¬µ«ÕâÑù³ÌÐò¿Ï¶¨Òª½øÐÐÐÞ¸ÄÁË¡£ÐèÒªÔÚ³ÌÐòÖÐΪ´Ë×Ö¶ÎÉèÖò»Öظ´ ......

ISA·À»ðǽ¿Í»§¶ËºÍSQLSERVER¿Í»§¶ËµÄÎÊÌâ

ÓÐÍâÀ´³ÌÐò°²×°»ùÓÚ.NET FRAMEWORK 3.5µÄÓ¦ÓóÌÐòÔÚÄÚÍøµÄPCÉÏ£¬ÐèҪͨ¹ýISA·À»ðǽ¿Í»§¶Ë¾­¹ý·þÎñÆ÷ÉϵÄISA2006 SP1·ÃÎÊÍâÍøµÄSQLSERVER2005Êý¾Ý¿â¡£
        °´ÕÕÒÔÍù¾­Ñ飬ÐèÒªÅäÖÃÒ»ÌõSQLSERVER2005·þÎñÆ÷ËùÔÚµÄIPµØÖ·µÄ³öÕ¾¹æÔò£¬²¢ÇÒ²¢²»ÐèÒªÉèÖÃÒ»Ìõ»ùÓÚÓòÃûµÄ¹æÔò¡£
 &nb ......

SqlServerÃüÃû¹æ·¶

SqlServerÃüÃû¹æ·¶
²Î¿¼¸÷ÖÖÃüÃû¹æ·¶£¬ÎÒÃÇͳһʹÓÃÃüÃû¹æ·¶ÈçÏ£º
ÃüÃû¹ý³ÌÖÐÈçÓÐÏÖ´æµÄËõд£¬ÔòʹÓøÃËõд£¬ÈçÎÞ£¬Ò»Âɲ»µÃËõд£¬Àý£ºISBN
Êý¾Ý¿â£ºÓÃÒ»¸ö»òÈý¸öÒÔÏÂÓ¢Îĵ¥´Ê×é³É£¬µ¥´ÊÊ××Öĸ´óд£¬È磺DepartmentManage£»
±íÃû£ºÊ¹ÓÃÃû´ÊÐÔÖʵĵ¥´ÊÈ«Æ´±íʾ£¬¸÷µ¥´ÊÊ××Öĸ´óд£¬ ʹÓø´ÊýÐÎʽ£¬È磺Books
 & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ