July 15, 2014 at 6:54 am
Or use MERGE. This will handle the case where you have new fruits in the first table that aren't in the second.
John
July 15, 2014 at 6:55 am
Hi,
Thats a question....where should i use the update statement...in front of select or after group by...the thing is when i set my column names equal to result table column names it doesnt recognize it.
July 15, 2014 at 7:09 am
Can i Do Delete from table and the INSERT new record into the table?
what are the potential hazards?
July 15, 2014 at 7:12 am
Yes, that should work, provided it doesn't break any referential integrity. Otherwise, use UPDATE with a JOIN, or MERGE.
John
July 15, 2014 at 7:15 am
Open up Books Online (the SQL help file, F1 in Management Studio), search for UPDATE and have a look at the syntax.
Yes, you can delete and insert, but why would you when there's an UPDATE statement and you're intending to update the row?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply