Previous Thread:   Name property of SqlUserDefinedType

1/21/2006 1:30:26 PM    Re: Null and UDTs
Hi Leila,  
  
You're using SSMS to do the SELECT, correct? This is a known problem with  
  
SSMS. You can use SQLCMD or an application program or call ToString() on  
  
your UDT in the SELECT statement.  
  
I wrote a few blog entries on this last August-Sept. You might reference  
  
those for the "long answer" of what is happening.  
  
Cheers,  
  
Bob Beauchemin  
  
http://www.SQLskills.com/blogs/bobb  
  
"Leila" <Leilas@hotpop.com> wrote in message  
  
news:OXHwevsHGHA.2300@TK2MSFTNGP15.phx.gbl...



1/21/2006 1:30:29 PM    Re: Null and UDTs
"Leila" <Leilas@hotpop.com> wrote in  
  
news:OXHwevsHGHA.2300@TK2MSFTNGP15.phx.gbl:  
  
I believe this is an error in SQL Server management studio. If you were  
  
to do a SELECT from SQL Command (sqlcmd) I think you'd see null.  
  
Niels  
  
--  
  
**************************************************  
  
* Niels Berglund  
  
* http://staff.develop.com/nielsb  
  
* nielsb@no-spam.develop.com  
  
* "A First Look at SQL Server 2005 for Developers"  
  
* http://www.awprofessional.com/title/0321180593  
  
**************************************************

1/21/2006 10:39:15 PM    Re: Null and UDTs
As you did not provide any code or at least link where you copied the code  
  
from, I have to guess. I think .NET native types are used instead of  
  
SqlTypes which support NULL values.  
  
--  
  
Dejan Sarka, SQL Server MVP  
  
Mentor, www.SolidQualityLearning.com  
  
Anything written in this message represents solely the point of view of the  
  
sender.  
  
This message does not imply endorsement from Solid Quality Learning, and it  
  
does not represent the point of view of Solid Quality Learning or any other  
  
person, company or institution mentioned in this message

1/22/2006 12:15:36 AM    Null and UDTs
Hi,  
  
I am trying to use Point UDT from MSDN. But when I insert a null into this  
  
column, my SELECT on the table generates an error:  
  
An error occurred while executing batch. Error message is: Data is Null.  
  
This method or property cannot be called on Null values.  
  
Any help would be greatly appreciated.  
  
Leila

1/22/2006 2:33:09 AM    Re: Null and UDTs
Thanks Bob,  
  
ToString() solved the problem!  
  
"Bob Beauchemin" <no_bobb_spam@sqlskills.com> wrote in message  
  
news:%23gYK7GtHGHA.2036@TK2MSFTNGP14.phx.gbl...