DECLARE @cnt INT = 1; WHILE @cnt BETWEEN 1 AND 20 BEGIN PRINT @cnt; SET @cnt = @cnt+1; END
SQL Doesn't have For Loop, instead you have to use While loop.
DECLARE @cnt INT = 1; WHILE @cnt BETWEEN 1 AND 20 BEGIN PRINT @cnt; SET @cnt = @cnt+1; END
DECLARE @cnt INT = 1; WHILE @cnt BETWEEN 1 AND 20 BEGIN PRINT @cnt; SET @cnt = @cnt+1; END
SELECT sobjects.name FROM sysobjects sobjects WHERE sobjects.xtype = 'U'
<xsl:choose> <xsl:when test="$a > $b"> <h2> A is greater than B </h2> </xsl:when> <xsl:otherwise> <h2> B is greater than A </h2> </xsl:otherwise> </xsl:choose>
<!-- .xsl file -->
<!-- List of items to be checked against -->
<xsl:variable name="students" select="'Jon Tom Ana Ben'" />
<!-- Item to be checked if contained in list -->
<xsl:variable name="classTopper" select="'Ana'" />
<!-- Alternately the item can be dynamically taken from the xml input file as below -->
<!-- <xsl:variable name="classTopper" select="/root/@topper" /> -->
<!-- Check if class topper is in the students list -->
<xsl:if test="
contains(
concat(' ', $students, ' '),
concat(' ', $classTopper, ' ')
)
">
<xsl:value-of select="concat('Student ', $classTopper, ' is in the students list.')" />
</xsl:if>
concat ('|', $list, '|') ...