sqlserver´¥·¢Æ÷ ÈçºÎÈ¡¸üÐÂÇ°µÄÖµ
sqlserver´¥·¢Æ÷ ÈçºÎÈ¡¸üÐÂÇ°µÄÖµ??
oracle¿ÉÒÔÓÃ:oldÀ´È¡Öµ£¬sqlserver¿ÉÒÔÓÃʲô?
CREATE TRIGGER [khjfbd] ON [dbo].[¿Í»§ÐÅÏ¢]
FOR UPDATE
AS
if update([µ±Ç°»ý·Ö])
insert into ¿Í»§»ý·Ö±ä¶¯(khid,ÐÕÃû,²Ù×÷Ô±,tzrq,Ô»ý·Ö,лý·Ö)
select id,¿Í»§Ãû³Æ,'ss',getdate(),´Ë´¦ÐèҪȡ¸üÐÂÇ°µÄÖµÔõôд,µ±Ç°»ý·Ö from inserted a
°ÑÔÀ´µÄ±íÄÃÀ´¹ØÁª
SQL code:
select
id,¿Í»§Ãû³Æ,'ss',getdate(),´Ë´¦ÐèҪȡ¸üÐÂÇ°µÄÖµÔõôд,µ±Ç°»ý·Ö
from
inserted a ,¿Í»§ÐÅÏ¢ b
where
a.id=b.id
http://blog.163.com/cdf_2008/blog/static/760647782009112621855536/
¸üеĶ¯×÷Äã¿ÉÒÔ·Ö2²½Àí½â£¬ÏÈdelete ,ÔÙinsert
ËùÒÔ£¬Ç°µÄÖµÔÚ deletedÀï
ºóµÄÖµÔÚ insertedÀï
Ïà¹ØÎÊ´ð£º
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class QueryTest&n ......
СµÜÏÖÔÚSwingÔÚÁ¬½ÓÊý¾Ý¿âÉÏÓöµ½Ò»µãÎÊÌ⣬ÇëÎÊSwingÀïÃæµÄʼþºÍSQLserverÊý¾Ý¿âµÄÁ¬½ÓÓÐʲôºÃµÄ×ÊÁÏÊéÍƼöÂð£¿
Õâ¸öÓ¦µ±Ã»ÓÐʲôÌرð,ÓëÆäËûµÄ±à³ÌÒ»Ñù.
JDBC
ÇëÎÊÔÚSwingÖмÓÔر³¾°Í¼Æ¬ÊÇÔõô¼ÓµÄ£¿
......
ÔÚÊý¾Ý¿âÖÐÓÐÕÅ±í£¬ÓÐid,nameÁ½ÁУ¬id ÊÇÖ÷¼ü,ûÓÐÉèÖÃ×ÔÔöÊôÐÔ,ÔÚ³ÌÐòÖÐÈ¡³öÕâÕűí·ÅÈëdatatable£¬ÔÚÕâ¸ödatatableÖвåÈëÒ»Ìõ¼Ç¼£¬µ±¸üÐÂÊý¾Ý¿âʱÌáʾidÁв»ÄÜΪ¿Õ£¬ÇëÎʸÃÔõô½â¾ö£¿
¸øËüÒ»¸öÖµ£¡£¡Ö÷¼ü²»ÄÜΪ¿Õ ......
´ÓÍøÉϲ鵽µÄ×ÊÁÏ˵£¬ÈκÎÊý¾ÝÀàÐÍÓëNULLÖµ½øÐмÆË㣬½á¹û¶¼½«ÎªNULL.
select null-1
½á¹ûÊÇnull
¿ÉÊÇÏÂÃæÕâ¸ö²éѯΪʲô»á³ö´íÄØ£¿
select isnull(null-1,'test');
¾ÓÈ»±¨´í˵½«varcharתΪintʧ°Ü¡£
Ϊʲô» ......
¼ÙÉèÎÒµÄÊý¾Ý¿âÊÇ·ÅÔÚµçÄÔAÀ¶øÍøÕ¾·ÅÔÚµçÄÔBÀÄÇÎÒÏÖÔÚÒªÊÇÏ뱸·ÝµçÄÔAÉϵÄÊý¾Ý¿âµ½µçÄÔBµÄ´ÅÅÌÀÎÒ¸ÃÔõô×ö£¿Ï£Íû´ó¼Ò¸ø°ï°ï棬×îºÃÄܸø¸ödemo¡£ÎÒÓÊÏäÕ˺ţº952378159@qq.com ÏÈлл¸÷λÁË°¡£¡
ÓкܶàÖÖ· ......