how to store a value returned from a sql query in a variable in batch programming ?
i can invoke sqlserver queries from my cmd prompt using sqlcmd server name then the qwery
this is query statement i m going to use
SELECT CASE WHEN DATEDIFF(minute, record_timestamp, GETDATE()) < 10 THEN 1 ELSE 0 END
how to store the value returned
i tried using set variablename but it save the statement rather than the return value ..
and if i save this in a variable what type of variable it will can i compare it with numeric values in if condition