I would like to tell my inline SQL script to not show the error
"Violation of Primary Key constraint: Cannot insert duplicate key"
but display a custom warning message instead.
Is this possible?
Code: Select all
IF EXISTS(SELECT * FROM languageStrings)
RAISERROR('Data was already found in database. Skipping insertion.',16,1)
ELSE
BEGIN
INSERT INTO languageStrings ...
INSERT INTO languageStrings ...
INSERT INTO languageStrings ...
END
GOCode: Select all
INSERT INTO languageStrings ...
GO
INSERT INTO languageStrings ...
GOCode: Select all
INSERT INTO languageStrings ...
INSERT INTO languageStrings ...
GOCode: Select all
BEGIN TRY
INSERT INTO languageStrings ...
GO
INSERT INTO languageStrings ...
GO
END TRY
BEGIN CATCH
RAISERROR('This error should be shown',16,1)
END CATCHCode: Select all
BEGIN TRY
INSERT INTO languageStrings ...
INSERT INTO languageStrings ...
END TRY
BEGIN CATCH
RAISERROR('This error is never visible in AI',16,1)
END CATCH
FOLLOW US
Get the latest news in Application Packaging