June 15, 2018 at 10:54 am
I'm trying to update my table[Provider_DB].[dbo].[ContinuingEdProvider] with data from my other table [Provider_DB].[dbo].[MasterProviderList] but my syntax is wrong... any ideas?:UPDATE [Provider_DB].[dbo].[ContinuingEdProvider] a
SET a.[ContactFName] = b.[FirstName],
a.[ContactLName] = b.[LastName]
FROM (
SELECT b.[ProviderId], b.[FirstName], b.[LastName]
FROM [Provider_DB].[dbo].[MasterProviderList] b)
WHERE
a.[ProviderId] = b.[ProviderId]
June 15, 2018 at 10:59 am
briancampbellmcad - Friday, June 15, 2018 10:54 AMI'm trying to update my table[Provider_DB].[dbo].[ContinuingEdProvider] with data from my other table [Provider_DB].[dbo].[MasterProviderList] but my syntax is wrong... any ideas?:UPDATE [Provider_DB].[dbo].[ContinuingEdProvider] a
SET a.[ContactFName] = b.[FirstName],
a.[ContactLName] = b.[LastName]
FROM (
SELECT b.[ProviderId], b.[FirstName], b.[LastName]
FROM [Provider_DB].[dbo].[MasterProviderList] b)
WHERE
a.[ProviderId] = b.[ProviderId]
Something like this?UPDATE a
SET
a.ContactFName = b.FirstName
, a.ContactLName = b.LastName
FROM
Provider_DB.dbo.ContinuingEdProvider a
JOIN Provider_DB.dbo.MasterProviderList b ON a.ProviderId = b.ProviderId;
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
June 15, 2018 at 11:06 am
Thank you that makes much more sense and works!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply