Answer the question
In order to leave comments, you need to log in
How to deal with a trigger in MSSQL - modify it so that CRM does not notice?
There is one windows crm with a database in MSSQL 2008, and in the customer table there, phones are entered without any mask, i.e. just as a person wrote, the phone was saved in the database. Accordingly, there are additional characters and spaces, and anything can be. And you need to search by phone number.
I decided to add a metaphone field to the table and make a trigger
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER dbo.relation_new_triu ON dbo.relation
WITH EXECUTE AS CALLER
FOR INSERT, UPDATE
AS
BEGIN
UPDATE dbo.relation SET metaphone = dbo.ExtractInteger(phone)
END
GO
ALTER TABLE dbo.relation
DISABLE TRIGGER relation_new_triu
GO
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question