I have an SQL Query that updates IDs in one table based on a join to records in another table. The issue is that for some reason that I do not understand the Update query is actually displaying the results on the query to the grid in SSMS. This is causing an 'Out of Memory Exception' on my machine because it is trying to show 1 million + results in the grid. It is interesting because the query should not display anything except the number of records updated. Any ideas what I am doing wrong?
Here is an example of my query:
UPDATE MyDatabase.dbo.Notes
SET ParentID = A.ID
FROM MyDatabase.dbo.Notes N
JOIN MyDatabase.dbo.Actions A ON N.OldID = A.OldID
WHERE A.OldID IS NOT NULL
AND N.OldID IS NOT NULL
AND N.ParentID IS NULL
The code listed in your question will not cause any output to the Grid in SSMS by itself
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