Skip to the content.

If you definitely haven’t populated a table-variable, then: doing something with the values (that aren’t there) is probably not what you intended.

Populate the table!

(the table-variable will implicitly be empty, but… you probably meant it to be something else)

Bad:

declare @t table (Value int not null);
select Value from @t;

Good:

declare @t table (Value int not null);
insert @t (Value) values (1);
select Value from @t;