📄 ti_showinserted.vb
字号:
Imports System
Imports System.Data
Imports System.Data.Sql
Imports System.Data.SqlTypes
Imports Microsoft.SqlServer.Server
Imports System.Data.SqlClient
Partial Public Class Triggers
' Enter existing table or view for the target and uncomment the attribute line
<Microsoft.SqlServer.Server.SqlTrigger(Name:="ti_ShowInserted", Target:="Person.ContactType", Event:="FOR INSERT")> _
Public Shared Sub ti_ShowInserted()
Dim oTriggerContext As SqlTriggerContext = _
SqlContext.TriggerContext
Dim sPipe As SqlPipe = SqlContext.Pipe
If oTriggerContext.TriggerAction = TriggerAction.Insert Then
Dim conn As New SqlConnection("context connection=true")
conn.Open()
Dim cmd As New SqlCommand("Select * from inserted", conn)
sPipe.ExecuteAndSend(cmd)
End If
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -