473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Disabilitazione trigger [DISABLE TRIGGER]

Salve, non riesco a disabilitare un trigger su sqlserver nè da query
analyzer, nè da enterprise manager.
In pratica tal cosa riuscivo a farla in Oracle con TOAD, mentre qui non
riesco.
Mi interessa disattivarlo senza cancellarlo per poi riattivarlo al bisogno
senza rilanciare lo script di creazione.
Grazie a tutti

Hi I need to disable a DB trigger and I'm not able to do this neither with
query analyzer, neither with enterprise manager.
I remeber this job was quite simple using TOAd in Oracle.
I'm interested in making it disabled not delete it, without run creation
script.

Thanks a lot to everybody.

Jul 20 '05 #1
4 6972
On Fri, 07 May 2004 18:01:11 GMT, Pecos Bill wrote:
Salve, non riesco a disabilitare un trigger su sqlserver nè da query
analyzer, nè da enterprise manager.
In pratica tal cosa riuscivo a farla in Oracle con TOAD, mentre qui non
riesco.
Mi interessa disattivarlo senza cancellarlo per poi riattivarlo al bisogno
senza rilanciare lo script di creazione.
Grazie a tutti

Hi I need to disable a DB trigger and I'm not able to do this neither with
query analyzer, neither with enterprise manager.
I remeber this job was quite simple using TOAd in Oracle.
I'm interested in making it disabled not delete it, without run creation
script.

Thanks a lot to everybody.


Hi Pecos,

ALTER TABLE MyTable
DISABLE TRIGGER MyTrigger

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
Jul 20 '05 #2
Pecos Bill (pe********@yahoo.it) writes:
Salve, non riesco a disabilitare un trigger su sqlserver nè da query
analyzer, nè da enterprise manager.
In pratica tal cosa riuscivo a farla in Oracle con TOAD, mentre qui non
riesco.
Mi interessa disattivarlo senza cancellarlo per poi riattivarlo al bisogno
senza rilanciare lo script di creazione.
Grazie a tutti
Ci sono due maniere di fare questo. Il più facile è a usare
ALTER TABLE tbl DISABLE TRIGGER tri. Ma bisogna comprendere che il
trigger è disabiliato per ogni usatori. Il alternativo e usare un
temp tabella, e nel trigger scrivi:

IF object_id('tempdb..#trigger_disabilitato') IS NULL
BEGIN
.. il code del trigger suivi qui.
END

Il tabella non bisogna avere qualche dati, solamente esistere per
disabilitare il trigger.
Hi I need to disable a DB trigger and I'm not able to do this neither with
query analyzer, neither with enterprise manager.
I remeber this job was quite simple using TOAd in Oracle.
I'm interested in making it disabled not delete it, without run creation
script.


There are two ways to do this. The simplest is to use ALTER TABLE tbl
DISABLE TRIGGER tri. But you need to understand that this disables the
triggers for all users. The alternative is to use a temp table as a flag.
The temp table does not need to have any data, only to exist to disable
the trigger.


--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3
thank you very much.
Alessandro
Jul 20 '05 #4
grazie tantissimo.

thanks a lot.
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Steve Bishop | last post by:
I have an Insert, Update and delete trigger on a table that works fine. It records the changes into another table called tblTracking. tblTracking records the changes so they can be uploaded to...
7
by: ZRexRider | last post by:
Hi, I have trigger that enforces the creation of a sortorder that is always 1 digit higher than the current highest on Inserts. This trigger works great if I add one row at a time so I think...
13
by: Tolik Gusin | last post by:
Hello All, DB2 UDB 8.1 FP3 for Linux The table has 4 triggers on the Insert operation. Three triggers small (200 bytes) and one trigger large (3 ËÂ). In the large trigger there is one long...
18
by: Bill Smith | last post by:
The initial row is inserted with the colPartNum column containing a valid LIKE pattern, such as (without the single quotes) 'AB%DE'. I want to update the column value with the results of a query...
1
by: Philippe Lang | last post by:
Hello, Dropping a trigger is permitted if the user is the owner of the table for which the trigger is defined. In a plpgsql function, used by different users, I need to disable some triggers...
2
by: Dima Gofman | last post by:
I have a trigger on UPDATE on a table. I'm running some maintenance UPDATE and DELETE queries which I want the trigger to ignore but at the same time I want other UPDATE queries that other users...
7
by: Wojto | last post by:
Hello! Another day, another problem... :-) I've got something like this: CREATE TABLE A ( pk_A INT CONSTRAINT primarykey_A PRIMARY KEY ); CREATE TABLE B (
11
by: tracy | last post by:
Hi, I really need help. I run this script and error message appeal as below: drop trigger log_errors_trig; drop trigger log_errors_trig ERROR at line 1: ORA04080: trigger 'LOG_ERRORS-TRIG'...
5
by: nirmalsanjaya | last post by:
I want to disable a trigger as soon as it got triggered. But dont know how to do this. Could anyone please help me? Thanks, sanjaya
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.