Home All Groups Group Topic Archive Search About
Author
21 Jan 2006 8:45 PM
Leila
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

Author
21 Jan 2006 9:30 PM
Bob Beauchemin
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
>
>
>
Author
21 Jan 2006 11:03 PM
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
>>
>>
>>
>
>
Author
21 Jan 2006 9:30 PM
Niels Berglund
"Leila" <Lei***@hotpop.com> wrote in
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.
>

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
**************************************************
Author
21 Jan 2006 9:39 PM
Dejan Sarka
> 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.

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

AddThis Social Bookmark Button