Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
lyw
Starting Member
5 Posts |
Posted - 2008-03-28 : 13:26:00
|
| hi eveyrone,I have an after insert trigger that works in sql2000 but not in sql2005. Can you please help me!!CREATE trigger dbo.trUPS_tbl_Ion dbo.UPS_tblAfter Insert --For insertas declare @Tracking varchar(800), @UPSID varchar(10), @Cmmd varchar(800) select @UPSID = cast(inserted.UPSID as varchar) from inserted commit set @Cmmd = 'c:\Tasks\UpdTracking\UpdateTrackingCS ' + @UPSID + ' ' + 'UPS1' EXEC master.dbo.xp_cmdshell @CmmdThe UpdateTrackingCS program will call a stored procedure to get the inserted data and update other databases. And the reason to put the commit statement in sql2000 is to have sql commit the transaction, so the store procedure in UpdateTrackingCS can query thtat inserted records. When I use the same code in SQL2005, no matter what I do the UpdateTrackingCS program cannot query the data by the UPSID. It always says record not found. I have tried to change commit to begin trans ... commit trans. But nothing works. Please help!Thanks in advance.lyw |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|