Bob
2012-06-06 00:56:27 UTC
Can I put a sql command in the "Then" part of a Case ?
Something like this:
Case @MIY
When 0 Then Update dbo.EMI Set fieldA=@insertString Where CID=@CID
When 1 Then Update dbo.EMI Set
fieldB=@insertString Where CID=@CID
When 0 Then Update dbo.EMI Set
fieldC=@insertString Where CID=@CID
When 1 Then Update dbo.EMI Set
fieldD=@insertString Where CID=@CID
End
Something like this:
Case @MIY
When 0 Then Update dbo.EMI Set fieldA=@insertString Where CID=@CID
When 1 Then Update dbo.EMI Set
fieldB=@insertString Where CID=@CID
When 0 Then Update dbo.EMI Set
fieldC=@insertString Where CID=@CID
When 1 Then Update dbo.EMI Set
fieldD=@insertString Where CID=@CID
End