I am doing work for a client who uses SQL Server 2000. I told them I need to log into the server as the Windows user the SQL Service is running as so that I can set up some drive mappings and such that they need the server to have. However, they informed me they lost the password and have no...
Ohhh... Well, following your logic from above it would be something like this (I'm assuming deprtmnt is your PK):
CREATE TRIGGER [trgDeleteUPR40300_kml] ON [dbo].[UPR40300]
for delete
AS
delete
from gpviews.dbo.upr40300
where dbase='two'
and deprtmnt in (select deprtmnt from deleted)
If you're trying to do the same thing, joining to the deleted table instead of the inserted table should give you what you need. You also don't need the "If Update" logic. Just the update statement itself.
If you're doing the same thing regardless of update or delete you could just do this:
CREATE TRIGGER [trgUpdateUPR40300_kml] ON [dbo].[UPR40300]
for update, delete
If you need it do something different you'd want to create a separate trigger starting like this:
CREATE TRIGGER...
You say, "when that field is changed on the front end" but your trigger appears to be an insert trigger only. Therefore it only fires when the row is inserted:
CREATE TRIGGER [trgUpdateUPR40300_kml] ON [dbo].[UPR40300]
for insert
Try this:
CREATE TRIGGER [trgUpdateUPR40300_kml] ON...
What happens when you run:
exec sp_helpreplicationdboption
go
How many changes do you need to make?
If it's only a couple you can do something like this on a replicated DB:
alter table address add XCoord_bak decimal(8,5)
GO
update address
set XCoord_bak = XCoord
GO
exec sp_repldropcolumn...
I have a table called "CLAIMS". It contains these fields among others:
MemberID
ClaimID
PaidAmt
ProviderID
ServiceDt
PaidDt
A ClaimID can be adjusted and contain multiple lines (for example, a claim is paid at $59, then a second line may take back the amount ($-59) and a third line may repay...
Not trying to be picky but that above trigger would not work if you had a multi-row update. You'd need to do something like this:
CREATE TRIGGER Test_Update ON bob FOR UPDATE
AS
insert into bob2 (idnumber, n)
SELECT idnumber, n
FROM Deleted
Craig
I'm not sure what your customers are doing with their data but one option would be to create a view of the table in question and then you can name each field whatever you wish. Then have the customers access the view.
Of course, if you're talking about some sort of front end app that...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.