Home > database >  Ssqlserver can modify the error message? Information or success?
Ssqlserver can modify the error message? Information or success?

Time:12-26

Such as I have A table field A character type is int, now I want to go to inside put A value of 'ABC', execute the statement, the database will prompt: 'in A varchar value' ABC 'failure' when converted to data type int, I want the database to quote this kind of "please enter an integer",
Another situation is that the assumptions and the above fields A character type is int, successfully saved after user input '123', but there is no hint, I want the database to prompt "digital saved",
In both cases can achieve? For some reason, can't modify the front end program, it is not possible through the front end program to achieve the above requirements,

CodePudding user response:

If the stored procedure, it's play to you,
If not, that don't have to say,

CodePudding user response:

Trace SQL statement found are executed directly with SQL statements, moderator is big mean wouldn't stand a chance?
How to implement a stored procedure? The trouble moderator greatly

CodePudding user response:

The "front-end" is directly take ERROR_MESSAGE ()?
ERROR_MESSAGE () the return results can also change, magic, to learn

CodePudding user response:

refer to the second floor qq_37023291 response:
trace SQL statement found are executed directly with SQL statements, the moderator is big mean wouldn't stand a chance?
How to implement a stored procedure? Trouble moderator greatly the ha

The program can change you call SQL, write a stored procedure also useless, you couldn't change the statement to call a stored procedure

CodePudding user response:

reference 4 floor big watermelon cut a piece of a kilo of reply:
Quote: refer to the second floor qq_37023291 response:
trace SQL statement found are executed directly with SQL statements, the moderator is big mean wouldn't stand a chance?
How to implement a stored procedure? Trouble moderator greatly the ha

The program can change you call SQL, write a stored procedure also useless, you couldn't change the statement to call a stored procedure

If the program is called directly in the stored procedure, you can directly in the stored procedure with the transaction and trycatch raiserror!
but though this can be submitted to the custom error, but still don't know what you want from one end of the database program
  • Related