darjab
darjab

Reputation: 129

How to make a simple counter in VBscript -> MSSQL

How to make a simple counter in VBscript counting from 0, 1, 2, etc. to infinity ... that each number was entered in another record in the database MSSQL ID column?

Upvotes: 0

Views: 611

Answers (1)

Arulkumar
Arulkumar

Reputation: 13237

You can do by the Do Until loop starting from 0 to execute up to infinity, check the condition as i = -1.

Then you can use the i value in your required purpose

<script language="vbscript" type="text/vbscript">
  i = 0
  Do Until i = -1
    Document.write(i)
    ' Use for the MSSQL ID column
    i = i + 1
  Loop
</script>

Upvotes: 1

Related Questions