Hey guys i have a question.
Is there a way to in the Select statement declare variables that equal a select statement and then do case logic on that variable and depending on the case logic increment another variable.
Ex.
What that does it sets a variable and then increments the health based off that variable.
- Matt
"If I must boast, I will boast of the things that show my weakness"
- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008
Is there a way to in the Select statement declare variables that equal a select statement and then do case logic on that variable and depending on the case logic increment another variable.
Ex.
Code:
Declare @Variable String
Declare @Health Integer
Select [Column1],
SET @Variable = (SELECT STATEMENT)
Case @Variable = 0
@Health = @Health + 1
Case @Variable = 1
@Health = @Health + 2
End Case
@Health as 'Health'
What that does it sets a variable and then increments the health based off that variable.
- Matt
"If I must boast, I will boast of the things that show my weakness"
- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008