Reputation: 147
I'm trying to insert a count but I get and error
Incorrect syntax near the keyword 'SET'.
Am I going about this the wrong way?
INSERT INTO Timestamp_ActiveReferralscopy
SET count = (select count(HashID)
from [dbo].[T_PTID]
where date_of_Death is null AND Deduction_Date is null)
Upvotes: 0
Views: 4730
Reputation: 595
is this what you're looking for?
INSERT INTO Timestamp_ActiveReferralscopy (count)
select count(HashID) from [dbo].[T_PTID]
where date_of_Death is null AND Deduction_Date is null
....
Upvotes: 1