2014年1月10日

SQL 触发器 instead of | insert

摘要: create trigger tgr_Inserton Ainstead of insertasprint 'Hello World'goinsert into A values('100')--在触发器之前执行插入goselect * from Ago--禁用disable trigger tgr_Insert on A go--启用触发器enable trigger tgr_Insert on Ago 阅读全文

posted @ 2014-01-10 11:41 程序猴chengxuhou.com 阅读(1707) 评论(0) 推荐(0) 编辑

SQL SERVER 使用select和union插入多条数据

摘要: insert into A(A)select '2' unionselect '3' unionselect '100'goselect * from A 阅读全文

posted @ 2014-01-10 10:23 程序猴chengxuhou.com 阅读(569) 评论(0) 推荐(0) 编辑

SQL SERVER UNION和UNION ALL

摘要: union与union allunion 缺省在合并结果集后消除重复项,union all 指定在合并结果集后保留重复项, 打个比喻吧 比如A表的数据是 A{ 1,4,5,9} B{2,3,4,5}那我执行此语句 select * from A union select * from B 那结果是{1,2,3,4,5,9}如果执行select * from A union all select * from B 结果是{1,2,3,4,4,5,5,9} 阅读全文

posted @ 2014-01-10 10:16 程序猴chengxuhou.com 阅读(426) 评论(0) 推荐(0) 编辑

导航