I have an SQL query that declares a table inside it.
Declare @t table(tagname nvarchar(50), Value float, timestamp datetime)
Then I insert some date in this table. Once this is done, I want to update another table (already created) from @t.
Something along the lines of:
UPDATE Optimiser_tagData
SET Optimiser_tagData.value = @t.value
where Optimiser_tagData.tagName = @t.tagName
This obviously does not work, and I get this error:
Must declare scalar variable "@t"
I am sure that I am missing something very light, but I cannot understand it.
source
share