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

SQLÓï¾äÎÊÌâ

create trigger TR_Delete_pm_WorkCard
on pm_WorkCard
for delete
as
if @@rowcount=0 return
begin tran
  update pm_PlanEntry
  set FDispatchQty=t4.FDispatchQty - t1.FDispatchQty
  from deleted as t2 join pm_WorkCardEntry as t1 on(t1.fparentid=t2.FInterID)
      join pm_Plan t3 on(t2.FPlanID=t3.FInterID)
      join pm_PlanEntry as t4 on(t3.FInterID=t4.fparentid and t1.FRowID=t4.FRowID)
if @@error=0
  commit tran
else
  rollback tran

±íÖÐ×Ö¶ÎûÓÐÎÊÌ⣬´¥·¢Æ÷Äܹ»Ö´Ðгɹ¦£¬¾ÍÊǵò»µ½Ô¤ÆÚµÄЧ¹û¡£
ÄãÏÈ°ÑÀïÃæµÄ²éѯÓï¾äÈ¥Ö´ÐÐһϿ´¿´Ð§¹û

ÒýÓÃ
ÄãÏÈ°ÑÀïÃæµÄ²éѯÓï¾äÈ¥Ö´ÐÐһϿ´¿´Ð§¹û


ͨ¹ýÕâ¸öÓï¾ä
select *
from pm_WorkCard as t2 join pm_WorkCardEntry as t1 on(t1.fparentid=t2.FInterID)
      join pm_Plan t3 on(t2.FPlanID=t3.FInterID)
      join pm_PlanEntry as t4 on(t3.FInterID=t4.fparentid and t1.FRowID=t4.FRowID)

Äܵõ½Êý¾Ý¡£

if @@rowcount=0 return --ÎÊÌâÊDz»ÊÇÔÚÕâÀÓÐÓÃÂð£¿

ÒýÓÃ
if @@rowcount=0 return --ÎÊÌâÊDz»ÊÇÔÚÕâÀÓÐÓÃÂð£¿

¾õµÃÊÇûʲôÓÃ,ºÇºÇ,±¾À´¾ÍÊǺ󴥷¢ÁË

ÒýÓÃ
if @@rowcount=0 return --ÎÊÌâÊDz»ÊÇÔÚÕâÀÓÐÓÃÂð£¿


Ïà¹ØÎÊ´ð£º

ÃÅÍ⺺ÇóÖú...¹ØÓÚºǫ́+SQL+ASP

....½Óµ½Ò»¸öС³ÌÐò..¹¤×÷Ô­À´´ó¸ÅÊÇÕâÑùµÄ...ǰ̨ÊÇWEB·þÎñÆ÷.¼Ü¹¹¾ÍÊÇASP+SQL..ǰ̨ÓÉASPÏòSQLÌí¼Ó·þÎñÀà±ð(±íµ¥).È»ºóÓÖºǫ́³ÌÐò¶ÁÈ¡±íµ¥..Ҫʵʱ¶ÁÈ¡..È»ºóÏÔʾÔÚ·þÎñÆ÷ÉÏÃæ..´ÓÀíÂÛÉÏÃæÄÜÐÐͨ²»?Èç¹û¿ÉÒÔ..ºǫ́ ......

asp.netÈçºÎÁ¬½ÓSQL SERVERÊý¾Ý¿â

ÎÒ°²×°SQL SERVER2008µÄʱºòÑ¡ÔñWINDOWSÉí·ÝÑéÖ¤Á¬½ÓµÄ£¬ÎÒ²»ÖªµÀÔõôдÁ¬½Ó¡£¡£¡£
»¹ÓÐÎÒÏë¸Ä³ÉSQL SERVERÉí·ÝÑéÖ¤Ôõô¸Ä£¿£¿
лл´ó¼ÒÁË£¡
XML code:

<configuration>
<appSettings>
& ......

Çë½Ìoracleµ¼³öµ½sql server2005

û¸É¹ýÕâÊ£¬Ò²²»ÖªµÀoracleÊý¾Ý¿âɶÑù£¬Çë½Ì´óϺÃǾßÌå²½ÖèÊÇʲô£¿ÐèҪעÒâЩʲô£¿


ORACLEÊý¾Ý¿âÀï±íµ¼ÈëSQL ServerÊý¾Ý¿â
   
  1¡¢ÔÚÄ¿µÄSQL ServerÊý¾Ý¿â·þÎñÆ÷ÉÏ°²×°ORAC ......

¼òµ¥µÄsqlÎÊÌâ

ÐÕÃû  ѧ¿Æ
a      ÓïÎÄ
a      Êýѧ
b      Ó¢Óï
b      ÕþÖÎ

ÎÒÏëµÃµ½  a    ÓïÎÄ£¬Êýѧ
  ......

sql inÎÊÌâ

listidÊÇintÊý¾Ý
declare @listid nvarchar(100)
set @listid='(1,2,3,7,9,10)'
select * from forums where listid in(@listid)ʱÌáʾÈçÏ´íÎó£º
ÔÚ½« nvarchar Öµ '(1,2,3,7,9,10)' × ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ