469,604 Members | 2,381 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,604 developers. It's quick & easy.

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 6784
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Steve Bishop | last post: by
7 posts views Thread by ZRexRider | last post: by
13 posts views Thread by Tolik Gusin | last post: by
18 posts views Thread by Bill Smith | last post: by
1 post views Thread by Philippe Lang | last post: by
2 posts views Thread by Dima Gofman | last post: by
7 posts views Thread by Wojto | last post: by
reply views Thread by guiromero | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.