Solved

Question for vujos

Posted on 2000-04-07
2
239 Views
Last Modified: 2012-05-04
Regarding triggers on system tables, my experience has been as simonsabin says.  I created it but it never fired regardless how i tried.
Please  provide me with the explanation how to create it and have it execute.
0
Comment
Question by:xoxomos
2 Comments
 
LVL 1

Accepted Solution

by:
vujos earned 50 total points
Comment Utility
Hi,

Following is tested on MSSQL 6.5 (did not have time yet to try on 7.0).

But let's start :

1)<enable update on system tables>

sp_configure 'allow update', 1
reconfigure with override

2)<make syslogins table visible in EM>

update sysobjects set sysstat = 99 where name = 'syslogins' and id = 33

3)<add custom message>

sp_addmessage 50009, 16, 'This is my test message'

4)<create trigger for add, upd of login>

CREATE TRIGGER reminder ON syslogins
FOR INSERT, UPDATE AS RAISERROR (50009, 16, 10)
GO

3)<make syslogins invisible in EM>

update sysobjects set sysstat = 113 where name = 'syslogins' and id = 33

4)<disable system tables updates>

sp_configure 'allow update', 0
reconfigure with override

5)<try to add new login from EM or run>

sp_addlogin 'test1', 'testing', 'master', default


Well there you go, you still think that this was easy ?

General comment is still walid : any playing with system tables should be avoided. If you have to, please backup all the databases (you could end up rebuilding your master db - you know what that is). Please do not try above on production system. This is only an demo.

Hope this helps.

0
 

Author Comment

by:xoxomos
Comment Utility
O.K.  i'll try that and keep in mind not to do it on a production system ---- just yet.  I'm using 6.5 anyhow.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now