Thru my program it is storing –1.#QNAN in float data type field. I want to restrict Sql Server to store this value and if program is giving this as input then it store 0 in place of it. Is there any way to give formula or trigger something to check it?
if you are inserting the data through a stored proc and you are passing "–1.#QNAN" parameter as a varchar type, then you can check it out using: if isnumeric(@paramname) ...
if you are inserting it directly from a client program, then you should do the validation there before even sending it to sql server.
Thanks alfredp77.
I am not passing -1.#QNAN intentionally. It might be like ado when reading empty field from float data type or we loose network it is storing -1.#QNAN. We have done lot of checks on client program. Now I have given 0 as default value when we insert empty record. If any other clue please let me know. If we are passing 0 everytime then still it happens, I did not get it how it happens.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.