t sql update table variale

Solutions on MaxInterview for t sql update table variale by the best coders in the world

showing results for - "t sql update table variale"
Maëlys
09 Feb 2020
1UPDATE @searchResult
2SET [record_id] = r.[record_id], 
3    [record_name] = r.[record_name]
4FROM @searchResult SR
5CROSS APPLY (
6    SELECT TOP 1 *
7    FROM [records]
8    WHERE [record_name] LIKE [name_template]   -- Your wish, but do you really need LIKE matching??
9    ORDER BY [record_id] DESC
10) AS r;