Click here to Skip to main content
15,917,176 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
isnull(x.n.value('(SLP)[1]','varchar(50)'),0) as 'SLP'

SLP is varchar type ,so how to convert varchar to int
Maciej Los 4-Mar-15 15:26pm    
'SLP' is a string and can not be converted into integer.
John C Rayan 4-Mar-15 16:10pm    
Your question is unclear. Can you elaborate?

1 solution

use cast or convert outer side like

cast(isnull(x.n.value('(SLP)[1]','varchar(50)'),0) as int) as 'SLP'
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900