|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Null and UDTsHi,
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 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 Show quote "Leila" <Lei***@hotpop.com> wrote in message news:OXHwevsHGHA.2300@TK2MSFTNGP15.phx.gbl... > 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 > > > Thanks Bob,
ToString() solved the problem! Show quote "Bob Beauchemin" <no_bobb_spam@sqlskills.com> wrote in message news:%23gYK7GtHGHA.2036@TK2MSFTNGP14.phx.gbl... > 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" <Lei***@hotpop.com> wrote in message > news:OXHwevsHGHA.2300@TK2MSFTNGP15.phx.gbl... >> 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 >> >> >> > > "Leila" <Lei***@hotpop.com> wrote in I believe this is an error in SQL Server management studio. If you were news:OXHwevsHGHA.2300@TK2MSFTNGP15.phx.gbl: > 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. > 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 ************************************************** > I am trying to use Point UDT from MSDN. But when I insert a null into this As you did not provide any code or at least link where you copied the code > 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. 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 |
|||||||||||||||||||||||