About
Pricing
Community
Teams
Start Free Trial
Log in
Merion
asked on
2/28/2009
ISNULL is truncating my verchar(max) field
I have a 2 sub query in the my isnull() function.
subquery1 = varchar(100)
subquery2 = varchar(max)
select
isnull (subquery1,subquery2) as test
from table1
join table2 on table1.id = table2.field2
where table1.x = table2.y
the problem is my subquery2 is getting truncated when i get the result..
any help will be greatly appreciated.
Microsoft SQL Server
5
1
Last Comment
Merion
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Guy Hengel [angelIII / a3]
2/28/2009
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
sampipes
2/28/2009
try isnull(CAST(subquery1 AS varchar(MAX), subquery2)
aibusinesssolutions
2/28/2009
It looks like it is assigning varchar(100) to "test", and if it's null it keeps the varchar(100), so the answer would be to set both subqueries to varchar(max).
aibusinesssolutions
2/28/2009
Dang, gotta be fast around here.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Merion
2/28/2009
ASKER
Thanks a lot. I was struggling with it form past 2 hours.....