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  | 
                             
                            
                                    | 
                                         mattster2020 
                                        Starting Member 
                                         
                                        
                                        6 Posts  | 
                                        
                                        
                                            
                                            
                                             Posted - 2012-01-11 : 11:49:53
                                            
  | 
                                             
                                            
                                            | Afternoon All,I'm using the function below in SQL2008 to convert a binary to hexmaster.sys.fn_varbintohexstr(@Supp_Attach_id)Our production enviroment uses SQL2000, does anyone know of a function or code that can do the same?Regards,Matt | 
                                             
                                         
                                     | 
                             
       
                            
                       
                          
                            
                                    | 
                                     sunitabeck 
                                    Master Smack Fu Yak Hacker 
                                     
                                    
                                    5155 Posts  | 
                                    
                                      
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     mattster2020 
                                    Starting Member 
                                     
                                    
                                    6 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2012-01-11 : 13:16:17
                                          
  | 
                                         
                                        
                                          | Thanks Sunitabeck,I have compiled the following code:				Declare @Supp_Attach_id binary(8), @Supp_Attach_Name varchar(300), @hexstr varchar(300), @cmd varchar(1000)					set @Supp_Attach_id = 0x00000000000000B8					set @Supp_Attach_Name = 'email3.txt'					set @hexstr = '' 					exec master.dbo.xp_varbintohexstr @Supp_Attach_id, @hexstr output 					print @hexstr					--SET @CMD = '\\Poland\Filepath\Email_Attach_Temp\App\Save_Attachments' + ' ' + master.sys.fn_varbintohexstr(@Supp_Attach_id) + ' ' + @Supp_Attach_Name					SET @CMD = '\\Poland\Filepath\Email_Attach_Temp\App\Save_Attachments.exe' + ' ' + (@hexstr) + ' ' + @Supp_Attach_Name										Print @cmd										EXEC master..xp_CMDShell @CMD	Doesnt seem to be converting the binary to hex correctly though?  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     sunitabeck 
                                    Master Smack Fu Yak Hacker 
                                     
                                    
                                    5155 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2012-01-11 : 14:39:02
                                          
  | 
                                         
                                        
                                          | Unfortunately, I don't have SQL 2000 to test this or see its behavior (I know so little about SQL 2000 in any case).Hopefully someone else who has more familiarity with SQL 2000 will respond.  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     Transact Charlie 
                                    Master Smack Fu Yak Hacker 
                                     
                                    
                                    3451 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2012-01-11 : 17:23:18
                                          
  | 
                                         
                                        
                                          | I wrote a post about this ages ago, I'll try and find itCharlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     Transact Charlie 
                                    Master Smack Fu Yak Hacker 
                                     
                                    
                                    3451 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2012-01-11 : 19:02:38
                                          
  | 
                                         
                                        
                                          | This is what I was thinking of : http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=138869Not sure if it's helpful though....Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |   
     
     
            
              
	     |  
		
			
     
          
		 |