Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
UPDATE [DR_HeatPumpCalc].[dbo].[tbl_lkupHeatPumps] if @Filetype <> '' SET [ImageFilename] ='heatpump-' + Convert(varchar(50),@NewHeatPumpID) + @Filetype, else SET [ImageFilename] = NULL if @PDFFiletype <>'' [PDFDatasheetPath] = 'heatpump-' + Convert(varchar(50),@NewHeatPumpID) + @PDFFiletype else [PDFDatasheetPath] = NULLWHERE [HeatPumpID] = @NewHeatPumpID
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2012-09-27 : 10:21:59
it should be CASE ...WHEN
UPDATE [DR_HeatPumpCalc].[dbo].[tbl_lkupHeatPumps] SET [ImageFilename] =CASE WHEN @Filetype <> '' THEN 'heatpump-' + Convert(varchar(50),@NewHeatPumpID) + @Filetype ELSE NULL END,[PDFDatasheetPath] = CASE WHEN @PDFFiletype <>'' THEN 'heatpump-' + Convert(varchar(50),@NewHeatPumpID) + @PDFFiletype ELSE NULL ENDWHERE [HeatPumpID] = @NewHeatPumpID
------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
eljapo4
Posting Yak Master
100 Posts
Posted - 2012-09-27 : 10:31:06
thank you this is just what I was doing after a bit of thought
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2012-09-27 : 10:33:12
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/