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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Update through stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-11-11 : 10:36:25
Ujvala B writes "I need to update three columns on a table through my stored procedure. Columns should be updated only when the corresponding passed parameter is not null. How can I have a single update statement that will update only those columns that have a not null update value.
Thanks."

mr_mist
Grunnio

1870 Posts

Posted - 2002-11-11 : 10:45:58
quote:

Ujvala B writes "I need to update three columns on a table through my stored procedure. Columns should be updated only when the corresponding passed parameter is not null. How can I have a single update statement that will update only those columns that have a not null update value.
Thanks."



Update yourtable set
columna = isnull (@input, columna)

Go to Top of Page
   

- Advertisement -