I have a need to Iterate through records in an ms sql stored procedure and insert a record per row. Is this possible? something like..
select Name From users
foreach (user)
{
insert into UserData(test,UserName)values('test',user.Name)
}
Any help would be greatly appreciated, I know I could run this on the clients but I want it run from the stored procedure.
select Name From users
foreach (user)
{
insert into UserData(test,UserName)values('test',user.Name)
}
Any help would be greatly appreciated, I know I could run this on the clients but I want it run from the stored procedure.