Dear Experts,
We want to create a check when the user is going to add or update in UDT. Please mention that the UDT is not reffered to UDO.
We have created the below part of the Transaction when the user is going to add but it doen't work.
IF (@object_type = N'Account Data') AND (@transaction_type IN (N'A'))
BEGIN
DECLARE @AcctType NVARCHAR(10)
SET @AcctType = (SELECT TOP 2 U_AcctType FROM [@ZAM_2NDJE] WHERE Code = @list_of_cols_val_tab_del ORDER BY Code DESC)
IF @AcctType = 'PC'
BEGIN
SET @error = 1000001
SET @error_message = 'Please choose a valid Account Type'
END
END
Do you have any advice?
Thank you in advance.
Kind Regards,
Alexandros Karadimitropoulos