Microsoft
Software
Hardware
Network
Question : Is there a problem with using temporary tables in a sql Insert/Update Trigger
I have a trigger (posted below)...I'm wondering if there are any problems with my method of creating a temporary table to manipulate the data or if another method is preferred. My main reason for doing it this way is to avoid specifying the column names in the last Insert statement...really to avoid changing the trigger in the future when columns are added or removed.
ALTER TRIGGER [dbo].[TR_Table_INSERT_UPD
ATE]
ON [dbo].[Table]
AFTER INSERT,UPDATE
AS
BEGIN
SET NOCOUNT ON;
DECLARE @Cnt int
SELECT @Cnt=COUNT(*) FROM INSERTED
--Make sure at least 1 record is affected before continuing
IF @CNT>0
DECLARE @Field1 nvarchar(50)
SELECT
@Field1=MasterField1
FROM MasterTable
DELETE FROM Database.dbo.Table WHERE Field1=@Field1
SELECT * INTO #INSERTEDTable FROM INSERTED
UPDATE #INSERTEDTable SET Field1=@Field1
INSERT INTO Database.dbo.Table SELECT * FROM #INSERTEDTable
END
Answer : Is there a problem with using temporary tables in a sql Insert/Update Trigger
please follow the below links
its very helpful
http://www.priscilla.com/i
psecexampl
e.htm
http://www.petri.co.il/how
-to-config
ure-ipsec-
encryption
-
with-cisc
o-ios.htm
Random Solutions
Multiple CAS, Multiple Sites
use wireshark to capture whats happening during the logon process
connect an iPhone to Windows SBS 2003
sql update keeps stopping serivces
I am trying to load windows xp on a hp g71-340us laptop. The factory installed OS is windows 7 Home Premium. When the set-up disk is loading i get a Stop 0x0000007b BSOD.
how to install certificate in SBS 2008
Import Contacts / Calendar Items Outlook POP PST to OWA
what is the best way to remove opachki.ru trojan?
How can I record two DV (firewire) inputs simultanously to a PC or Mac?
SoposAdministrator