Data Masking in SQL Server 2005
-
venerdì 27 aprile 2012 08:51
Good Day!
Need help. Hope you have time for this. I was getting an error message while trying to MASK a data in SQL Server 2005. I use UPDATE and REPLACE statements to MASK a data. It is working on my test database but when I tried it on live database I get an error message. Please see details below.
Syntax:
- UPDATE TABLENAME SET COLUMNNAME = REPLACE(COLUMNNAME, 'A', '[')
Error:
- Msg 512, Level 16, State 1, Procedure cmf_upd_trg, Line 10 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. The statement has been terminated.
Thank you very much!
Tutte le risposte
-
venerdì 27 aprile 2012 08:54
The real suspect is that you are having a trigger on that table that is designed to handle a single update.Thanks and regards, Rishabh K
- Proposto come risposta Murali_CHN venerdì 27 aprile 2012 09:04
- Contrassegnato come risposta KJian_ giovedì 3 maggio 2012 06:13
-
mercoledì 2 maggio 2012 03:58
Hi! Thank you for your reply. May i know what to do? Ü
Mark.
-
mercoledì 2 maggio 2012 04:12
Have a look inside the trigger cmf_upd_trg code.
ESHANI. Please click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you
- Contrassegnato come risposta MB-Mark lunedì 7 maggio 2012 04:18
-
mercoledì 2 maggio 2012 07:19Thanks for all your responses. Let me try to look for that cmf_upd_trg. Ü
-
venerdì 4 maggio 2012 04:34
Hi! wasn't able to locate that cmf_upd_trg. Seems my SQL statement only allows me to update only one record. I'm getting this error message whenever I update 2 or more records.
Syntax: UPDATE TABLENAME SET COLUMNNAME = REPLACE(COLUMNNAME, 'A', '[')
Thank you very much! Ü
-
venerdì 4 maggio 2012 14:10Moderatore
In SSMS first find the table in the Object Explorer, then click on the expand it and look under triggers to find the trigger that is written wrongly.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog- Modificato Naomi NMicrosoft Community Contributor, Moderator venerdì 4 maggio 2012 14:10
- Contrassegnato come risposta MB-Mark lunedì 7 maggio 2012 04:18
-
lunedì 7 maggio 2012 03:38Hi everyone! I was able to locate cmf_upd_trg. I see a lot of codings their. Do I need to edit something there or would you know what to do next? Thank you very much. Ü
-
lunedì 7 maggio 2012 12:30ModeratorePost that trigger's code, we will be able to find the problem.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog -
venerdì 11 maggio 2012 09:24
Hi everyone!
Thank you for your time responding to my queries. I was able to update my database. I did not edit anthing in cmf_upd_trg code. I disable it then I execute my REPLACE funtion.
UPDATE TABLENAME SET COLUMNNAME = REPLACE(COLUMNNAME, 'A', '[')
Again, thank you very much for all the support.
Sincerely,
Mark
- Contrassegnato come risposta MB-Mark venerdì 11 maggio 2012 09:24
-
venerdì 11 maggio 2012 12:16ModeratoreIf that trigger was there for a reason, the better solution would have been to correct that trigger's code.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog -
lunedì 14 maggio 2012 03:19
Thank you for your advise. I will ask our Database Administrator about it. But for now I just disable it and enable it after I MASK everything. Thanks a lot! Ü
Mark

