hI all,
One NULL is not equlal to another null.
So I use the functin if(ISNULL(@i, NULL) = NULL).
But this also didn't produce the correct Output.
May I know Why?
I had created a TEMP table and worked like this.
What the wrong.and how to change that one?.
When printing @i It produce only a single space ' '
DECLARE @i VARCHAR(20)
BEGIN
SET NOCOUNT ON
CREATE TABLE #temp (Item varchar(20))
INSERT INTO #temp(Item) VALUES('erty')
SELECT @i = Item FROM #temp WHERE Item = 'we'
DROP TABLE #temp
PRINT @i
IF(ISNULL(@i, NULL) = NULL)
BEGIN
PRINT 'Null'
END
ELSE
BEGIN
PRINT 'Not Null'
END
SET NOCOUNT OFF
END
One NULL is not equlal to another null.
So I use the functin if(ISNULL(@i, NULL) = NULL).
But this also didn't produce the correct Output.
May I know Why?
I had created a TEMP table and worked like this.
What the wrong.and how to change that one?.
When printing @i It produce only a single space ' '
DECLARE @i VARCHAR(20)
BEGIN
SET NOCOUNT ON
CREATE TABLE #temp (Item varchar(20))
INSERT INTO #temp(Item) VALUES('erty')
SELECT @i = Item FROM #temp WHERE Item = 'we'
DROP TABLE #temp
PRINT @i
IF(ISNULL(@i, NULL) = NULL)
BEGIN
PRINT 'Null'
END
ELSE
BEGIN
PRINT 'Not Null'
END
SET NOCOUNT OFF
END
Comment