asp多条sql语句
Ⅰ 镐庢牱鍦ˋSP椤甸溃涓钖屾椂浣跨敤澶氭浔sql璇鍙ワ纻
涓岖敤锛佷綘鍙瑕佹敞镒忔疮娆℃煡璇㈠彇鍑虹粨鏋滃悗鍏抽棴鏁版嵁闆嗗氨鍙浠ヤ简
浣嗗傛灉瀛桦湪闀跺祵镄勬儏鍐靛垯闇瑕併备絾鏄鍗充娇闀跺祵镄勬儏鍐靛叾瀹炰篃鍙浠ラ氲繃澧炲姞鍒ゆ柇镐ц川镄勫彉閲忔潵瑙e喅銆
涓句釜渚嫔瓙锛
set rs=server.CreateObject("ADODB.RecordSet")
sql="select * from table1"
rs.open sql,conn,1,3
while not rs.eof
vara=rs("vara")
varb=rs("varb")
rs.movenext
wend
rs.close '娉ㄦ剰杩栾岋纴鍙瑕佸叧闂鏁版嵁闆嗗悎灏卞彲浠ヤ简
sql="select * from table2" '鎺ョ潃鏀规庝箞鍐椤氨镐庝箞鍐椤氨鍙浠ヤ简
while not rs.eof
vara=rs("vara")
varb=rs("varb")
rs.movenext
wend
rs.close
rs.open sql,conn,1,3
Ⅱ asp锛氢竴涓猚onn.execute()鑳藉悓镞舵墽琛2𨱒sql璇鍙ュ悧锛
缁忚繃涓浜烘祴璇曪纴SQL SERVER 鍙浠ュ氲鍙ユ墽琛岋纴ACCESS涓嶅彲浠
澶氲鍙ユ墽琛屼緥瀛(璇鍙ヤ箣闂寸敤鍒嗗彿;闅斿紑):
Conn.execute("select * from a ; select * from b")
Ⅲ asp.net 濡备綍涓娆℃墽琛屽氭浔浠禨ql璇鍙ワ纴濡备綍瑙e喅锛
涓や釜镆ヨ㈣鍙ヤ腑闂寸敤绌烘牸镙煎紑灏卞彲浠ヤ简锛屼綘闾i噷鐢ㄥ垎鍙凤纴鍏跺疄宸茬粡阌欎简銆傚綋铹跺彧镆ュ埌浜嗙涓𨱒$殑鏁版嵁銆
鍙﹀栵纴濡傛灉澶氭浔sql璇鍙ヤ腑锛屾湁鏂板炴垨淇鏀癸纴鍒犻櫎锛屾渶濂界敤浜嫔姟锛岄伩鍏嶅彧镓ц屼竴閮ㄤ唤sql 镄勭粨鏋溿