473,391 Members | 1,469 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,391 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 6973
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.