Why I can't delete row from temporary table?
DECLARE @tbl2 TABLE
(
Id int,
ImieNazwisko varchar(200),
Pesel varchar(200),
Kod varchar(200)
)
DELETE FROM @tbl2 tblT WHERE tblT
SELECT * FROM @tbl2
also this doesn`t work:
DELETE FROM @tbl2 WHERE @tbl2.Id
You can delete from a temprorary table. It's just your syntax seems wrong.
Try this:
--drop table #temptable
create table #temptable (Id int)
insert into #temptable
select 1 union
select 2 union
select 3
delete from #temptable
where Id =2
select Id from #temptable
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