April 30, 2010 at 11:01 am
Hi!!!
The variable is initialized in a stored procedure with the value present in a table.
It is disappearing at later point of time.The data type of variable is Char.
Tried to print the value, it displays as NULL.:(
Please help me...
April 30, 2010 at 11:15 am
chaturvedi.garima (4/30/2010)
Hi!!!The variable is initialized in a stored procedure with the value present in a table.
It is disappearing at later point of time.The data type of variable is Char.
Tried to print the value, it displays as NULL.:(
Please help me...
so....are you going to show us the stored procedure? can't really help without that; there must be something changing the data if you say it was initialized to some value, or it was not assigned a value from your table when ou thought it was.
Lowell
April 30, 2010 at 11:18 am
chaturvedi.garima (4/30/2010)
Hi!!!The variable is initialized in a stored procedure with the value present in a table.
It is disappearing at later point of time.The data type of variable is Char.
Tried to print the value, it displays as NULL.:(
Please help me...
I second the part of needing to see the code. If there are lots of lines in the code you may need to Keep trying to put print statements in various spots to see what the value is to try by process of elimination find where you're assigning NULL to it.
---------------------------------------------------------------------
Use Full Links:
KB Article from Microsoft on how to ask a question on a Forum
April 30, 2010 at 11:22 am
Is it possible that the statement retrieving the value from the table does not actually return a row..? This would make the variable NULL.
As the other posts have said, we are happy to help if you post your code. 😉
April 30, 2010 at 11:24 am
Just a shot in the dark without being able to see the code, but if you're using the variable in any concatenation operation, you might want to set the CONCAT_NULL_YIELDS_NULL option off and try it again. With the option on, any concatenation with a NULL will change the entire string to NULL.
April 30, 2010 at 11:35 am
Just FYI, CONCAT_NULL_YIELDS_NULL will always be on in future versions of SQL Server.
April 30, 2010 at 6:55 pm
David Webb-200187 (4/30/2010)
Just a shot in the dark without being able to see the code, but if you're using the variable in any concatenation operation, you might want to set the CONCAT_NULL_YIELDS_NULL option off and try it again. With the option on, any concatenation with a NULL will change the entire string to NULL.
Oh... absolutely correct but I wouldn't do it that way especially since it's already known that future versions of SQL Server will not have the option of turning it off. Better to use ISNULL() for such things.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply