Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How to use ISNULL with this select statement

$
0
0

Hello All!

I have this SELECT statement.

SELECT 
      pref.value('(caseNo/text())[1]', 'varchar(20)') as CaseNumber,
      pref.value('(countyNo/text())[1]', 'int') as CountyNumber,
      pref.value('(histSeqNo/text())[1]', 'int') as HistorySequenceNumber,
      pref.value('(eventType/text())[1]', 'varchar(20)') as EventType,
      pref.value('(eventDate/text())[1]', 'datetime') as EventDate,
	 pref.value('(tag/text())[1]', 'varchar(50)') as Tag
FROM  
   dbo.CaseHistoryRawData_10 CROSS APPLY
      RawData.nodes('//CourtRecordEventCaseHist') AS CourtRec(pref)

I'm using this in a INSERT, but I'm getting NULL with the Tag column.  I'm trying to write in the ISNULL or COALESE , but I can't get the syntax right.

Thanks!

Rudy


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>