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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL Server 7 trigger arithmetic overflow error

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-01 : 09:56:44
Cuejay writes "This is my trigger:
(it's definitely primitive but it ALMOST gets the job done)

CREATE TRIGGER trgCntctInfoINS ON [NAME]
FOR DELETE
AS

DECLARE @NAMEID NUMERIC(10)
DECLARE @COMMAND CHAR(1000)

SELECT @NAMEID = (SELECT NAMEID FROM DELETED)

EXEC master..xp_cmdshell "cd E:"
EXEC master..xp_cmdshell "cd E:\jnet"
EXEC master..xp_cmdshell "cd E:\Jnet\contactinformation"

print @nameid

select @command = 'exec master..xp_cmdshell "call E:\Jnet\contactinformation\contactinfo.exe' + @nameid +'"'

exec @command
print @command

EXEC master..xpcmdshell "exit"


When I run it from query analyzer I get

"Server: Msg 8115, Level 16, State 6, Procedure trgCntctInfoINS, Line 36
Arithmetic overflow error converting varchar to data type numeric.
The statement has been terminated."

On
select @command = 'exec master..xp_cmdshell "call E:\Jnet\contactinformation\contactinfo.exe' + @nameid +'"'

I'm not converting anything!!! Does anyone know why I'm getting this error???
HEEEEEEEELLLLLLLLLLLLLLLLLLPPPPPPPPPPPPP"
   

- Advertisement -