I am running the following sql statement and would like to be able to default the date the statement was ran into all applicable records inserted on that date.
declare @date varchar(10)
set @date=convert(varchar, GETDATE(), 110)
INSERT Usage_HEAT (Tracker, Status)
SELECT LoginID, Status
WHERE Status %256>0
I have creted a variable to set the date but cannot come up with a good way to insert this into every record that is created during this insert. The date would be written into the date_used column in the table in which the records are inserted. In the future I will be tracking time as well as date, hence I wanted all records inserted when the statement is ran to have the same date and time. I do not want the time to be different between inserted records.