Will implicit data type conversion in SQL affect performance?
        Posted  
        
            by dboarman-FissureStudios
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by dboarman-FissureStudios
        
        
        
        Published on 2010-05-19T22:04:16Z
        Indexed on 
            2010/05/19
            22:10 UTC
        
        
        Read the original article
        Hit count: 376
        
c#
|sql-server
I have 2 samples that effectively do the same thing -- Sample 1:
command.Parameters.Add(ParamFoo, SqlDbType.Int)
command.Parameters(ParamFoo).Value = fooVal
Sample 2:
command.Parameters.AddWithValue(ParamBar, barVal)
Which sample would be recommended? I know that the second sample is making some conversions. Wouldn't it be best to not require conversions and go with the first sample?
© Stack Overflow or respective owner