This is why posting what you have in mind is so helpful.
No, you cannot do this. SQL is not that kind of language. You can easily
interested in consulting services. All other replies will be ignored :)
"Agnes" <agnes@dynamictech.com.hk> wrote in message
news:Ot2bpUvbEHA.3096@tk2msftngp13.phx.gbl...
> I need to specified the column ??
> infact, i got several column may be update (which depends on the case
> parameter)
> it seems wrong syntax if my code like this :-
> update mytable
> case @type
> when 'A' then a = a + 1
> when 'B' then b = b + 1
> end
>
> "Narayana Vyas Kondreddi" <answer_me@hotmail.com> ¦b¶l¥ó
> news:u$7yJJvbEHA.2292@TK2MSFTNGP09.phx.gbl ¤¤¼¶¼g...
> > Yes, something like this:
> >
> > UPDATE TableName
> > SET ColumnName = CASE WHEN <Condition1> THEN <Value1> WHEN <Condition2>
> THEN
> > 'Value2' ELSE 'Value3' END
> > WHERE <Some condition to select the rows>
> > --
> > Vyas, MVP (SQL Server)
> >
http://vyaskn.tripod.com/ > >
> >
> > "Agnes" <agnes@dynamictech.com.hk> wrote in message
> > news:%23EBiSjubEHA.1644@tk2msftngp13.phx.gbl...
> > > How about update statment ?
> > > After i select * from table, i need to update it at once.. but It
> depends
> > on
> > > the condition,
> > > Can update got the 'case' also ??
> > >
> > > "Agnes" <agnes@dynamictech.com.hk> ¦b¶l¥ó
> > > news:eiIlaFubEHA.2812@tk2msftngp13.phx.gbl ¤¤¼¶¼g...
> > > > I understand and try it later . Thanks
> > > > this syntax seems quit useful. as i don't need to create several
store
> > > > procedure
> > > > "Narayana Vyas Kondreddi" <answer_me@hotmail.com> ¦b¶l¥ó
> > > > news:eXnTy4mbEHA.3596@tk2msftngp13.phx.gbl ¤¤¼¶¼g...
> > > > > A quick example:
> > > > >
> > > > > SELECT EmpID, EmpName,
> > > > > CASE Sex
> > > > > WHEN 'm' THEN 'Male'
> > > > > WHEN 'f' THEN 'Female'
> > > > > ELSE 'Unspecified'
> > > > > END AS 'Sex'
> > > > > FROM Employees
> > > > >
> > > > > --
> > > > > HTH,
> > > > > Vyas, MVP (SQL Server)
> > > > >
http://vyaskn.tripod.com/ > > > > > Is .NET important for a database professional?
> > > > >
http://vyaskn.tripod.com/poll.htm > > > > >
> > > > >
> > > > > "Agnes" <agnes@dynamictech.com.hk> wrote in message
> > > > > news:un8wE0mbEHA.3096@tk2msftngp13.phx.gbl...
> > > > > Can I use select case in "stored procedure ???
> > > > > If yes, can someone be kind to give me a sample ??
> > > > > Thanks
> > > > > From SQL-newbie
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>