add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE EMPTY_TABLE(
ID INT
);

DECLARE @ID INT;
DECLARE @ROWS INT;

SELECT @ID = ID, @ROWS = COUNT(*)
FROM EMPTY_TABLE
Msg 8120 Level 16 State 1 Line 8
Column 'EMPTY_TABLE.ID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.