Quantcast
Channel: Programmer's Town - Count of lines in dynamic request
Viewing all articles
Browse latest Browse all 8

Re: Count of lines in dynamic request

$
0
0
SET @s = ' SET @cn = (SELECT Count (' + COL_NAME (OBJECT_ID (' Result '), @sch) + ')
FROM Result
WHERE Id_s = ' + @id_s + ' and ' + COL_NAME (OBJECT_ID (' Result '), @sch) +>>> ' between ' + @min + ' and ' + @max + ') ' <<<
execute sp_executesql @s, N ' @cn int output ', @cn out

Viewing all articles
Browse latest Browse all 8

Trending Articles