Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | shwethaStarting Member
 
 
                                        1 Post | 
                                            
                                            |  Posted - 2011-03-29 : 03:05:46 
 |  
                                            | hi,i have cretaed the view for a table.one field is of XML data type.when am using distinct while selecting all the fields from the view , its throwing error.Please help me to type cast the XML data type to varchar.Thanks in advanceShwetha |  |  
                                    | sunitabeckMaster Smack Fu Yak Hacker
 
 
                                    5155 Posts | 
                                        
                                          |  Posted - 2011-03-29 : 07:27:34 
 |  
                                          | You can cast it to varchar(max) and then do distinct as in select distinct cast(YourXMLColumn as varchar(max)) from YourTable |  
                                          |  |  |  
                                |  |  |  |