什么是魔法表。不同类型的魔法表 [英] what is magic table.different types of magic table

查看:100
本文介绍了什么是魔法表。不同类型的魔法表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是魔法表。不同类型的魔法表

解决方案

表INSERTED和DELETED被称为
SQL Server。我们无法在数据库中看到这些表。但我们可以从TRIGGER访问这些





当我们将记录插入表格时,魔术表INSERTED将被创建

在该表中,当前插入的行将可用。我们可以在TRIGGER中访问这个

记录。



当我们更新创建触发器的表上的记录时,将创建魔术表INSERTED和DELETED两者,更新的旧数据记录将在DELETED表中提供,新数据将在INSERTED表中可用,同时在触发器内访问它们。



当我们删除时从表中记录,将创建魔术表DELETED

在该表中,当前删除的行将可用。我们可以在TRIGGER中访问这个

记录。





从这里提取:

http://www.dotnetspider.com/resources /29332-Magic-tables-SQL-Server.aspx [ ^ ]



希望它有帮助


通常插入和删除的表格是名为Magic Tables.Magic Tables不包含有关



DataType文本,ntext或image的列的信息。这些由SQL Server维护,用于内部处理。更新,插入,删除发生在表上。但是我们可以在触发器中引用这些表。



每当更新的表语句被触发时SQL Server在更新之前维护原始行删除的表和插入表中的新(更新)行。

看看这个 SQL Server中的魔术表 [ ^ ]。



要获得更多结果,请参阅 Google搜索 [ ^ ]。


what is magic table.different types of magic table

解决方案

The tables "INSERTED" and "DELETED" are called magic tables of the
SQL Server. We can not see these tables in the data base. But we can access these
tables from the "TRIGGER"

When we insert the record into the table, the magic table "INSERTED" will be created
In that table the current inserted row will be available. We can access this
record in the "TRIGGER".

When we update a record on the table where trigger is created, the magic tables "INSERTED" and "DELETED" both will be created, the Old data of the updating record will be available in "DELETED" table and, the new data will be availalble in "INSERTED" table, while accessing them inside the trigger.

When we delete the record from the table, the magic table "DELETED" will be created
In that table the current deleted row will be available. We can access this
record in the "TRIGGER".


Extracted from here :
http://www.dotnetspider.com/resources/29332-Magic-tables-SQL-Server.aspx[^]

Hope It Helps


Usually Inserted and Deleted Tables are called Magic Tables.Magic Tables does not contain the information about

the Columns of the DataType text,ntext or image.These are maintained by SQL Server for internal processing whenver an update,insert,Delete occur on table.However we can refer these tables in Triggers.

Whenever an updated table statement is fired SQL Server Maintains the original row before updation in a deleted table and New(Updated) row in inserted table.


Have a look at this Magic Table in SQL Server[^].

For more results see this Google search[^].


这篇关于什么是魔法表。不同类型的魔法表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆