sqlserver ´¥·¢Æ÷ÎÊÌâ
ÎÒÏë×öÒ»¸ö´¥·¢Æ÷£¬µ«Ð޸ıíTµÄ×Ö¶ÎC1ʱ£¬ÅжÏÈç¹ûÐ޸ĺóµÄֵΪ-1£¬Ôò¸üбíT¸ÃÐмǼµÄ×Ö¶ÎC2Ϊijֵ¡£
CreateTRIGGER [Tri_UpdateLastSaveDate] ON [dbo].[T]
for UPDATE
AS
BEGIN
if update(C1)
begin
if inserted.C1='-1'
begin
update T set C2=convert(varchar,getdate(),21)
where C3=(select C3 from inserted);
end
end
END
¿ÉÊÇÖ´ÐеÄʱºò×ÜÊDZ¨´í£º
No row was updated.
Error Source:Microsoft.VisualStudio.DataTools.
Error Message: The row value(s) updated or deleted either do not make the row unique or they alter multiple rows(2 rows)
±íTûÓÐÖ÷¼ü£¬ÇÒC3×Ö¶Îʵ¼ÊÊÇΨһֵ
ÎÒ°ÑupdateÕâ¾ä»°È¥µô£¬Ð½¨ÁËÒ»¸ö±íAA£¬°üº¬×Ö¶Îc1¡¢c2£¬Ò²Ã»ÓÐÖ÷¼ü¡£
Ìæ»»³Éupdate AA set AA.C1='99' from AA,Inserted
where AA.C1=Inserted.C1
¿ÉÊÇ»¹ÊÇÌáʾÕâÑùµÄ´íÎó¡£
Çë°ïæ½â¾ö£¬×ż±¡£Ð»Ð»¡£
SQL code:
CreateTRIGGER [Tri_UpdateLastSaveDate] ON [dbo].[T]
for UPDATE
AS
BEGIN
if update(C1)
begin
update T set C2=convert(varchar,getdate(),21)
from T,inserted i
where T.C3=i.C3
and i.C1='-1';
end
END
SQL code
Code highlighting produced by Actipro CodeHighlighter (freeware
Ïà¹ØÎÊ´ð£º
ÎÒÏëÔÚÁíһ̨»úÆ÷ÉÏ·ÃÎʱ¾»úµÄsqlserver 2005 ¸ÃÔõôÅäÖá£Òª·ÃÎʵĻúÆ÷°²×°ÁËsqlserver 2005ÓõIJÙ×÷ϵͳÊÇwindows 2003 £¬Òª½øÐÐÔ¶³Ì·ÃÎʵĻúÆ÷Ò²°²×°ÁËsqlserver 2005 ÓõIJÙ×÷ϵͳÊÇwindows £Ø£Ð¡£¸ÃÔõôÅäÖòÅÄ ......
ÈçÌâ
Ö»ÓÐ100·Ö¸øÁË¡£¡£¡£
ÄĸöÐÐÒµ£¿
ÎÒÏëÍøÉϵÄÔ´Âë¿Ï¶¨²»ÄÜÍêÈ«Âú×ã¸öÈËÏë·¨
×îºó»¹µÃ×Ô¼ºÕû
ÍƼöÒ»¿î×ÔÖú½¨Õ¾Èí¼þ£º·çѶ
C#+SQL
¿ÉÒÔÉè¼Æ³ö±È½ÏÁé»îµÄÍøÕ¾
ʲôÐÐÒµ°¡....
µ½51aspx.co ......
ÔÚSqlServerÖÐÈçºÎ²é¿´ÀúÊ·ÉÏÖ´ÐеĴ洢¹ý³ÌµÄÐÅÏ¢ÄØ£¬È磺´«Èë²ÎÊý£¬Ö´ÐÐʱ¼äµÈµÈ¡£Èç¹û²»Äܲ鿴ÀúÊ·¼Ç¼£¬ÊÇ·ñ¿ÉÒÔ×Ô¼ºÐ´´¥·¢Æ÷Ö®ÀàµÄ£¬È˹¤¿ØÖÆÄØ£¬ÔÚOracleÀïÃæÓж¯Ì¬ÊÓͼ¿ÉÒÔËæʱ²é¿´ÀúÊ·Ö´ÐеÄsqlÓï¾ä£¬SqlSer ......
ÄÜ·ñÓÃÓï¾äʵÏÖ¡£¶ø²»ÊÇÏֳɵŤ¾ß£¿
Â¥ÉϵÄÐֵܿÉÒÔÏêϸһЩÂð£¿
×£Äã½ÚÈÕ¿ìÀÖ£¡¹þ¹þ
½ÚÈÕ¿ìÀÖ
SQL code:
Ò». µ¼³ö¹¤¾ß exp
1. ËüÊDzÙ×÷ϵͳÏÂÒ»¸ö¿ÉÖ´ÐеÄÎļþ ´æ·ÅĿ¼/ORACLE_HOME/bin
......
sqlserver´æ´¢¹ý³Ì¸Äoracle
˻ᰡ¡£¡£¡£°ïæ¸Ä¸Ä··
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER PROCEDURE tp_Fetch_List(
  ......