?
Solved

Question for vujos

Posted on 2000-04-07
2
Medium Priority
?
255 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
vujos earned 200 total points
ID: 2697150
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
ID: 2700889
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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

777 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