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.
Hi,Could you please let me know how to modify the below query if say the Description field is entered or not.For example in the query below the description field value is entered. But what if the Description field is not entered? What will the query look like then?Currently I have one update query if the description field is entered. And another update query if there is no Description field entered. I would like to have only one update query that takes into account the two scenarios.Thank youUPDATE Types SET [Name] = @NewName, [Description] = @Description, LastUpdatedDate = GetDate() WHERE TypeID = @TypeID
SwePeso
Patron Saint of Lost Yaks
30421 Posts
Posted - 2006-12-13 : 06:44:25
If either @NewName or @Description is NULL, the column value retain it's previous value