Previous Thread:   Exceptions calling basic CLR stored procs...

2/20/2006 2:55:55 PM    ValidationMethodName function
The doc says that this function is called when "converting" but not when new  
  
rows are added or changed. Ah, since it's not called on CONVERT, when IS it  
  
called? Can someone clarify this?  
  
--  
  
____________________________________  
  
William (Bill) Vaughn  
  
Author, Mentor, Consultant  
  
Microsoft MVP  
  
INETA Speaker  
  
www.betav.com/blog/billva  
  
www.betav.com  
  
Please reply only to the newsgroup so that others can benefit.  
  
This posting is provided "AS IS" with no warranties, and confers no rights.  
  
__________________________________



2/20/2006 7:31:19 PM    Re: ValidationMethodName function
"William (Bill) Vaughn" <billvaRemoveThis@nwlink.com> wrote in message  
  
news:eYbfPDnNGHA.3888@TK2MSFTNGP12.phx.gbl...  
  
It's called when you convert from bytes or when a UDT comes in from off the  
  
wire.  The primary reason for this is that it lets you validate your  
  
Format.Native UDT at creation time and handle the error as necessary, rather  
  
than having a cryptic failure somewhere down the line when it would be much  
  
harder to handle.  
  
It's not called by default on conversion from string because it's already  
  
been through the UDT's parse method, so any validation the user wanted to do  
  
could have been done at that time.  If you really want to run your  
  
ValidationMethod in this case, then it's pretty easy to add an explicit call  
  
to it from within the Parse method.  
  
Steven

2/21/2006 8:21:49 AM    Re: ValidationMethodName function
That's just what I need.  
  
Thanks  
  
--  
  
____________________________________  
  
William (Bill) Vaughn  
  
Author, Mentor, Consultant  
  
Microsoft MVP  
  
INETA Speaker  
  
www.betav.com/blog/billva  
  
www.betav.com  
  
Please reply only to the newsgroup so that others can benefit.  
  
This posting is provided "AS IS" with no warranties, and confers no rights.  
  
__________________________________  
  
"Steven Hemingray [MSFT]" <stevehem@online.microsoft.com> wrote in message  
  
news:%23TEHGdpNGHA.3064@TK2MSFTNGP10.phx.gbl...

2/22/2006 9:27:24 PM    Re: ValidationMethodName function
Hi Bill,  
  
It will call that method too (without explicit call in Parse method):  
  
INSERT MyTable(UDT_Col) VALUES(0x01800001800000)  
  
According to MSDN, these are the cases that this method is called:  
  
ValidationMethodName is also called during the running of the bcp utility,  
  
BULK INSERT, DBCC CHECKDB, DBCC CHECKFILEGROUP, DBCC CHECKTABLE, distributed  
  
query, and tabular data stream (TDS) remote procedure call (RPC) operations.  
  
The default value for ValidationMethodName is null, indicating that there is  
  
no validation method.  
  
Leila  
  
"William (Bill) Vaughn" <billvaRemoveThis@nwlink.com> wrote in message  
  
news:OR$5rLwNGHA.456@TK2MSFTNGP15.phx.gbl...