/**************************************************************************
说明: 通过触发器进行排除插入已存在的用户名的的操作
**************************************************************************/
CREATE TRIGGER trigger_student_insert
ON student
AFTER INSERT
AS
IF EXISTS(SELECT * FROM student,inserted WHERE student.stuName=inserted.stuName)
BEGIN
print 'name is san exist'
rollback transaction
END
insert into student values('tong',1,getDate(),'guangzhou')
/**************************************************************************
说明: 通过触发器进行排除插入分数大于100的操作
**************************************************************************/
USE school
GO
CREATE TRIGGER trigger_result_insert
ON result
AFTER INSERT
AS
IF(SELECT mark FROM student,inserted WHERE student.stuId=inserted.stuId)>100
BEGIN
print 'not insert mark > 100'
rollback transaction
END
INSERT INTO result values(3,3,101).
分享到:
相关推荐
Trigger an automatic rebuild and redeployment when you push changes to the repository Get a working environment up in minutes with application templates Use commands to check and debug your ...
Performance Analysis, SQL Monitor, Database Statistics, Recompute Selectivity of all Indices, Recompile Procedures and Triggers, global Stored Procedure/Trigger Operations Index analysis etc....
w Make use of server generated values (defaults, trigger modified columns) w Query By Example mode for high performance queryable forms without any programming w Use PL/SQL blocks for server logic in...
SQL Manager 2005 is compatible with any Firebird version up to 2.0 and InterBase version up to 7.5 and supports all of the latest features including trigger messages, BLOB filters, and so on....
SQL Manager 2005 is compatible with any Firebird version up to 2.0 and InterBase version up to 7.5 and supports all of the latest features including trigger messages, BLOB filters, and so on....
An isolation level determines the degree to which data is isolated for use by one process and guarded against interference from other processes. Prior to SQL Server 7.0, REPEATABLE READ and ...
Scripts that create or alter a procedure or trigger (UserVoice) TRUNCATE statements Format actions for aliases Add/remove AS keyword on alias definition for tables and views (UserVoice) Apply column ...
Percona XtraDB Cluster is a database clustering solution for MySQL. It ensures high availability, prevents downtime and data loss, and provides linear scalability for a growing environment. Features ...
You can now configure additional symbols that trigger automatic column name popups, for example, you may add <, , >, BETWEEN and other symbols to trigger automatic column popup display. SQL ...
Optionally you can specify -Drelease to trigger obfuscation and/or uglification (as needed) Optionally you can specify -Dmaven.test.skip=true to skip the tests (even though you shouldn't as you ...
• Trigger automated behaviors whenever specific events occur • Extend FileMaker’s functionality with plug-ins • Set up, configure, tune, and secure FileMaker Server All In Depth books offer • ...
CREATE TRIGGER UPDATE_ProNo_Stocks_TRIGGER ON Product FOR UPDATE AS PRINT'已即时更新每种产品的库存数量' GO --使用IF UPDATE(column)尽可能优化上题的触发器,以提高系统效率 ALTER TRIGGER ...
Using a Trigger File 20.2.6. Customizing the Restart Classloader 20.2.7. Known Limitations 20.3. LiveReload 20.4. Global Settings 20.5. Remote Applications 20.5.1. Running the Remote Client ...
I totally reworked the NT Service app sample application into a 100% functional application that shows you how to replicate a portion of a table into a separate database and how to put a full text ...
create database SQL0911061212 on primary ( name='TEST0DATA1',filename='D:\\MyTest\\TEST0DATA1.mdf', size=4,maxsize=20,filegrowth=1 ), filegroup TESTDATA2 ( name='TEST0DATA2',filename='D:\\MyTest\\...
structure data from PDB files can now be used, and are stored in a database for lookup later dissect structures form can now show a list of known structures (pdb, mono, ...) Added a "revert to saved ...
The library drive from Redis database source.please respect the author copyright of Redis.you can use the library as you want. The library just supports epoll and select event-trigger,and I will add ...
First, the content provider has more control over the user experience, since it has to use few intermediary ISPs. Second, it can save money by sending less traffic into provider networks. Third, if ...
The Use of Public Synonyms in a Multischema Database488 The Dreaded Cartesian Product 488 Failure to Enforce File System Structure Conventions 489 Allowing Large Tables to Take Default Storage ...
Deciding When to Use DBM and When to Use a Relational Database 255 Working with Relational Databases 255 Writing SQL Statements 257 Defining Tables 259 Setting Up a Database 260 Try It Out: ...