Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 what is this statement trying to do

Author  Topic 

cnaypi
Starting Member

22 Posts

Posted - 2008-08-21 : 19:29:34
I'm particularly interested with the ISNULL. Is this indicating to ignore any null values?

Update
ca
SET
RevItemName = RTRIM(RevItemName) + ' ' + ISNULL(LTRIM(RTRIM(rc.CodeAbbreviation)),'')
FROM
dbo.RevisionCode rc
INNER JOIN dbo.CA_ItemNameWorking ca ON ca.RevisionCodeId = rc.CodeId

Update
ca
SET
FullItemName = RTRIM(FullItemName) + ' ' + ISNULL(LTRIM(RTRIM(REPLACE(VAC.[Full],' ',''))),'')
FROM
dbo.CA_VLAttributeCodes VAC (NOLOCK)
INNER JOIN dbo.CA_ItemNameWorking ca ON VAC.CodeId = ca.RevisionCodeId AND VAC.CodeCategoryId = 52

Update
ca
SET
IdealItemName = RTRIM(IdealItemName) + ' ' + ISNULL(LTRIM(RTRIM(REPLACE(VAC.[Ideal],' ',''))),'')
FROM
dbo.CA_VLAttributeCodes VAC (NOLOCK)
INNER JOIN dbo.CA_ItemNameWorking ca ON VAC.CodeId = ca.RevisionCodeId AND VAC.CodeCategoryId = 52

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-08-21 : 19:31:44
It's replacing null values with ''.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-08-21 : 19:31:51
Replacing Null value with Blank.
Go to Top of Page

cnaypi
Starting Member

22 Posts

Posted - 2008-08-21 : 19:35:54
Thanks! one more question is this for Transact sql 2005? I am asking because I ran this statement using sql 2005 and the Null values are not being replaced with '' values NULLS are still showing up in my results
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-08-21 : 19:37:06
Perhaps the data has the word NULL in it and not an actual NULL value.

Word NULL:
SELECT * FROM YourTable WHERE YourColumn LIKE '%NULL%'

NULL data:
SELECT * FROM YourTable WHERE YourColumn IS NULL

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

cnaypi
Starting Member

22 Posts

Posted - 2008-08-21 : 19:49:58
Ah now I understand. Thanks!
Go to Top of Page
   

- Advertisement -