how do i get the rowcount of table variables?
If you mean SQL Server table variables, it's just like a normal table:
DECLARE @Foo TABLE
(
foo int
);
insert into @Foo values (1);
insert into @Foo values (1);
insert into @Foo values (1);
insert into @Foo values (1);
select COUNT(*) from @Foo;
SELECT COUNT(*) OVER ( ) AS 'RowCount' FROM @yourTableVariable
works perfect for table variables!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With