Hi all.
would someone be so kind as to help me work out this procedure pls..
I have this update command which runs through all rows in tblTwo and makes the value of field 'NameID' the same as the record in tblOne.
I know this has been asked a million times, and I have found some answers, but they are all wide and varying and I was looking for the simplest and most efficient way..
How do I modify this statement so that if the record doesn't exist in tblTwo, then insert it?
Thanks a lot
John
.NET 2.0, Visual Studio 2005, SQL Server 2005 Express
would someone be so kind as to help me work out this procedure pls..
I have this update command which runs through all rows in tblTwo and makes the value of field 'NameID' the same as the record in tblOne.
Code:
UPDATE [MyDatabase].[dbo].[tblTwo]
SET NameID = tblOne.NameID
FROM tblTEST
WHERE tblTwo.JobNo = tblOne.JobNo
I know this has been asked a million times, and I have found some answers, but they are all wide and varying and I was looking for the simplest and most efficient way..
How do I modify this statement so that if the record doesn't exist in tblTwo, then insert it?
Thanks a lot
John
.NET 2.0, Visual Studio 2005, SQL Server 2005 Express