create procedure sp_synchImagePhoto ( @file varchar(150) , @type varchar(20) , @width int , @height int ) as set nocount on begin if ( @type = 'full' ) begin update _photo set full_width = @width , full_height = @height where full_image = @file end else if ( @type = 'thumb' ) begin update _photo set thumb_width = @width , thumb_height = @height where thumb_image = @file end else if ( @type = 'feat' ) begin update _photo set feat_width = @width , feat_height = @height where feat_image = @file end end GO