on 07-23-2014 7:56 AM
Hi all,
For this stored procedure.
Possible to only apply it to 1 user only?
Take for example : -
Username : Receiver
-- Prevent blank K1 column in GRPO
IF @OBJECT_TYPE='20' AND @TRANSACTION_TYPE='A'
BEGIN
DECLARE @k1 nvarchar(100)
DECLARE @count INT
SELECT @docentry = 0
SELECT @docentry = CONVERT(INT, SUBSTRING(@list_of_cols_val_tab_del, 1, 10))
SELECT @k1=U_k1 FROM PDN1 WHERE PDN1.docentry=@docentry
IF @k1 is NULL
BEGIN
SET @error = 5
SET @error_message = 'K1 column cannot be blank !'
END
END
How can i apply this stored procedure for Receiver only.
Thank you,
Hi Adrian...
Yes It is Possible
IF @OBJECT_TYPE='20' AND @TRANSACTION_TYPE='A'
BEGIN
DECLARE @k1 nvarchar(100)
DECLARE @count INT
SELECT @docentry = 0
SELECT @docentry = CONVERT(INT, SUBSTRING(@list_of_cols_val_tab_del, 1, 10))
SELECT @k1=U_k1 FROM PDN1 WHERE PDN1.docentry=@docentry and usersign=' '
IF @k1 is NULL
BEGIN
SET @error = 5
SET @error_message = 'K1 column cannot be blank !'
END
END
Give the user sign in the ' ' at and usersign=' '
Hope Helpful
Regards,
Kennedy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can Use the SQl In function
Try this
IF @OBJECT_TYPE='20' AND @TRANSACTION_TYPE='A'
BEGIN
DECLARE @k1 nvarchar(100)
DECLARE @count INT
SELECT @docentry = 0
SELECT @docentry = CONVERT(INT, SUBSTRING(@list_of_cols_val_tab_del, 1, 10))
SELECT @k1=U_k1 FROM PDN1 t1 inner join opdn t2 on t1.docentry=t2.docentry WHERE t1.docentry=@docentry and t2.usersign in ( ' ' ,' ' , ' ' )
IF @k1 is NULL
BEGIN
SET @error = 5
SET @error_message = 'K1 column cannot be blank !'
END
END
Hope helpful
Regards,
Kennedy
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.