Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql stored procedure update if parameter is not null

Update [Users]
set    FirstName = IsNull(@FirstName, FirstName),
	   -- If you want to check for empty strings as well
       City = ISNULL(NULLIF(@City, ''), City),
       ....
Where  ...
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sql #stored #procedure #update #parameter #null
ADD COMMENT
Topic
Name
5+1 =