Are you looking for guidence in implementing nested loop, I mean a loop inside another. If yes, refer the following tutorial.
https://www.tutorialgateway.org/nested-sql-while-loop/
Hope this helps
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
ALTER PROCEDURE [cmn].[InsertXMLOutputConfig]
(
@P_DataSubject NVARCHAR(5),
@P_DRS NVARCHAR(10),
)
//i need help in iterating one while loop inside another while loop
//@P_DataSubject value is support 'as,ds,re,tr'
//@P_DRS value is suppose 'hrr,yte,ytw'
//@P_DataSubject i want to put in parent while loop and @P_DRS in child while loop
Are you looking for guidence in implementing nested loop, I mean a loop inside another. If yes, refer the following tutorial.
https://www.tutorialgateway.org/nested-sql-while-loop/
Hope this helps
You may be able to write your nested loops to solve your problem but it is not the right way to do so.
Think about your issue with nested loops in pseudo-code and implement a SET-based solution in your stored procedure.
If you need more assistance, you can provide more information and sample data and expected result.
You normally do not want to "loop" in SQL Server.
Can you explain more about what exactly your proc is expected to do?