Posted by Konstantin Kosinsky on 05/21/05 12:48
You can generate string with needly update sql and than call EXECUTE(@updateSql).
akej via SQLMonster.com wrote:
> Suppose i have table with 20 columns.
>
> My store proc takes two input parameters (param1, param2), now i need to
> UPDATE column with param2 according to param1:
> e.g
>
>
> if param1 = 222 --> UPDATE col1
> if param1 = 333 --> UPDATE col2
> .................
> .................
> ...........................
>
> Is it possible to acomplish it wiithout write 20 times the IF and UPDATE ??
>
[Back to original message]
|