all groups > sql server programming > april 2007 >
You're in the

sql server programming

group:

UPDATE statement for variable columns


RE: UPDATE statement for variable columns Ryan S
4/23/2007 2:20:03 PM
sql server programming:
Look up the isnull or coallesce statements in BOL.

Example...
field = isnull(@var, field)

--
Ryan S
Sr SQL DBA
1Jn5:12


[quoted text, click to view]
UPDATE statement for variable columns Tim Hobbs
4/23/2007 10:07:42 PM
I want to create a stored proc that updates some or all of the fields in a
table, with the calling application sending through values for only the
parameters it wants to change and NULL for those it isn't interested in.

I can do this with dynamic sql, but was hoping to do it with a static UPDATE
statement so I don't have to give base table access.

Is this possible? I'm using SQL 2005 SP2.

Thanks


Re: UPDATE statement for variable columns Tim Hobbs
4/23/2007 10:29:57 PM
Fabulous - thanks a million!

Tim


[quoted text, click to view]
AddThis Social Bookmark Button