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 |
bholmstrom
Yak Posting Veteran
76 Posts |
Posted - 2013-03-14 : 14:44:23
|
I have a procedure:CREATE PROCEDURE [UPDATE_STATUS] (@RecID int)AS Update ncos_Plain SET NC_Status_Updated = getdate()WHERE NC_UniqueID = @RecIDGO--------------------------------------------This procedure is getting called by a trigger on update:CREATE TRIGGER [update_status_date] ON [dbo].[NCOS_PLAIN] FOR UPDATEASEXEC UPDATE_STATUS NC_UNIQUEIDThe system throws an error:Error converting data type nvarchar to int.The field nc_uniqueid is a integer.Beyond that I would really only like to update the field when one fields is altered.Any thoughts ideas......ThanksBryan Holmstrom |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2013-03-14 : 15:33:54
|
EXEC UPDATE_STATUS NC_UNIQUEIDThat parameter value needs to either be an integer or a integer typed variable. that is why you're getting the error. but in any case you need to be able to deal with multiple values being updated in a single statement.use this as your trigger body instead:Update p SET NC_Status_Updated = getdate()from inserted ijoin ncos_Plain p on p.NC_UniqueID = i.NC_UniqueID Be One with the OptimizerTG |
|
|
|
|
|