Tsql can't update the column with count statement
- by desi
declare @t1 Table
(
a1 int
)
insert into @t1
select top 10 AnimalID from Animal
--select * from @t1
declare @t2 table
(
dogs int null
)
update @t2
set dogs = (Select COUNT(*) from @t1)
--------- The out put it gives me is just 0