codecontractor
Programmer
Ok, first of all, I would like to thank you all for your guidance in the past. I am new to SQL and SQL Server, but with the help of this forum I have picked it up pretty quickly.
So, my situation is:
I have a live (actively used) table which is full text indexed. I have another table that is actually a new version of that table, but it is not full text indexed. I am looking to update the LIVE table from the NEW table with a stored procedure/function. I would just rename the two, but then I lose the full text indexing.The tables have the same column names and the ID field is what I use to find records to compare. See my code below...
This just works for the one field, but I have 40 fields. Is there is a way to do this for multiple fields with one query like this?
Thanks,
-Ben
So, my situation is:
I have a live (actively used) table which is full text indexed. I have another table that is actually a new version of that table, but it is not full text indexed. I am looking to update the LIVE table from the NEW table with a stored procedure/function. I would just rename the two, but then I lose the full text indexing.The tables have the same column names and the ID field is what I use to find records to compare. See my code below...
Code:
ALTER PROCEDURE UpdateLive
-- This code finds records where the Title
-- field has changed in NEW and adjusts LIVE
AS
UPDATE live
SET live.Title = new.Title
FROM
NewTable as new INNER JOIN LiveTable as live
ON
(
live.ID = new.ID and
live.Title != new.Title
)
Thanks,
-Ben