If you don't have the permission to generate script according to an existing db, but you have the read permission for that db, if so you can use select to generate the expceted insert/delete/update statements, furtherly, you can also do complicated c…
Create Trigger [dbo].[upemployee_kefyu_sale] on [dbo].[employee] for update as if update(FullName) begin update erp.dbo.kefupp set erp.dbo.kefupp.saleperson =e.Fullname from [employee] e where e.typeid = erp.dbo.kefupp.etypeid update erp.dbo.salesper…
create trigger tr_aon afor insert,update,delere asbegin IF EXISTS(SELECT 1 FROM inserted) AND NOT EXISTS(SELECT 1 FROM deleted)BEGIN -- 插入触发. INSERT INTO B SELECT inserted.a FROM inserted;END; IF EXISTS(SELECT 1 FROM inserted) AND EXISTS(SELECT 1 FRO…
This is one of my most needed tool to create Insert and Update statements using select or alias from different tables where column mapping is difficult. What this utility actually does is, suppose you have two table with too many columns and you want…
在日常工作中,在SqlServer2008R2中,需要向一张表上加上触发器,监控插入.更新.删除. --一个触发器内三种INSERT,UPDATE,DELETE状态 IF exists(select 1 from inserted) and not exists(select 1 from deleted) begin --INSERT end IF exists(select 1 from inserted) and exists(select 1 from deleted) begin --…
Insert: 语法:INSERT INTO table_name (列1, 列2,...) VALUES (值1, 值2,....) 报错注入: insert into test(id,name,pass) values (6,'xiaozi' or updatexml(1,concat(0x7e,(database()),0x7e),0) or '', 'Nervo'); insert into test(id,name,pass) values (6,'xiaozi' or extract…
插入数据 使用Insert Into 插入 if(exists(select * from sys.databases where name = 'webDB')) drop database webDB go --创建数据库 create database webDB on primary ( name = 'webDB', filename='d:\webDB.mdf', size = 5mb, maxsize=unlimited, filegrowth% ) log on ( name =…