Writing a stored procedure that calls another stored procedure and provides values to it is something I need assistance with. To transfer this from C# to a stored procedure and create a SQL agent task that calls the stored procedure at a certain time is what I want to do now. Any thoughts? This holds true.
Table A:
PK_TableA_ID
Table B:
PK_TableB_ID
Stored procedure SP1:
@TableA_ID
@TableB_ID
I need this but in T-SQL
foreach(var TableAId in TableA)
{
foreach(var TableBId in TableB)
{
//call stored procedure
SP1(TableAId, TableBId);
}
}
Can someone please help me with this?