Skip to content
Advertisement

Tag: while-loop

sql while loop with date counter

I need to do something like this in sql: How can I do the above correctly in SQL? Basically, my startdate and enddate are strings and not datetimes because my business logic is referencing string column in another table with a date as the name of the column-But I need to loop through a bunch of columns, each column having

How to implement a do-while loop in tsql

I’m trying to figure how to implement this in TSQL The only iterative control flow sentence provided by Transact-SQL is while (condition) sentences that first evaluates the condition and if that condition is true then execute the sentence. I’m thinking in a scenario like execute a UPDATE statement over a table until some condition triggered y the last UPDATE executed

Advertisement