If I want to set a variable in a field in a table, I usually use something like
SELECT @UserIdToUpdate = userId FROM
In this case, there will be several results, and I just want the first one, so I tried this, but it fails and talks about the invalid syntax top
SELECT @UserIdToUpdate = TOP 1 UserId FROM
If so, can I just use the first example without a vertex? I guess he just takes the first record? I know that it seems strange, but the team is in a loop, so it will select the record, do something with it, delete it and select the next one.
source share