惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
宝玉的分享
宝玉的分享
G
Google Developers Blog
T
Tailwind CSS Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
V
Visual Studio Blog
博客园 - Franky
S
SegmentFault 最新的问题
Jina AI
Jina AI
爱范儿
爱范儿
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
D
DataBreaches.Net
C
Check Point Blog
月光博客
月光博客
P
Proofpoint News Feed
T
The Blog of Author Tim Ferriss
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
Martin Fowler
Martin Fowler

博客园 - 指南针

EpCloud开发日志 为服务创建安装程序 winform 通过WCF上传Dataset数据 opcrcw.da.dll 和.net 4.0 .net中线程同步的典型场景和问题(1) 如何取消后台线程的执行 python中使用汉字 Ext对基本类型的扩展 OWC ChartSpace控件的使用 OWC PivotTable的使用方法 Sql Server 生成数据透视表 wince5.0 key 修改IP地址后,原来的连接还有存在吗? Window下减少重绘的方法 .Net精简框加下子类化控件 Wince5.0中修改IP地址需不重启即可生效 Extjs combobox Windows workflow中的IEventActivity接口 javascript中的基本数据类型
使MSSql Server 视图可更新
指南针 · 2008-03-10 · via 博客园 - 指南针

1. 创建视图

2. 添加触发器

Create Trigger triggerName On ViewName Instead of Insert --用于Insert操作
as
Begin
    
--在这儿使用Inserted表来获得实际插入的数据,如
    Insert Into baseTable Select f1,f2 From Inserted

End

Create Trigger trigname On ViewName Instead of Update
as 
Begin
    
Set NOCount ON --不报告受影响的行数
    Declare @v1 type,v2 type -- 定义局部变量
    Select @V1=F1,@V2=F2 From Inserted --获取更新的数据
    Update BaseTabe Set F1=@V1,F2=@V2 Where ID=@ID
End

1Create Trigger trigname On ViewName Instead of Delete
2as 
3Begin
4    Set NOCount ON --不报告受影响的行数
5    Declare @ID int
6    Select @ID = ID From Deleted --这儿变成了Deleted表,Inserted表中始终为空。
7    Delete BaseTable Where ID=@ID
8End