SQL Server 2008 R2:错误

insert into [ULGP_CARES TEST].[dbo].[person](date_of_birth) select [Dtest].[dbo].[ContactBase].[BirthDate] from [Dtest].[dbo].[ContactBase] where [Dtest].[dbo].[ContactBase].[FirstName]=[ULGP_CARES TEST].[dbo].[person].[first_name] and [Dtest].[dbo].[ContactBase].[MiddleName]=[ULGP_CARES TEST].[dbo].[person]. [middle_name] and [Dtest].[dbo].[ContactBase].[LastName]=[ULGP_CARES TEST].[dbo].[person].[last_name] 

试图运行上面的查询时,我收到以下错误“消息4104,级别16,状态1,行6多部分标识符”ULGP_CARES TEST.dbo.person.first_name“无法绑定。消息4104,16级,状态1,行9不能绑定多部分标识符“ULGP_CARES TEST.dbo.person.middle_name”。消息4104,级别16,状态1,行11多部分标识符“ULGP_CARES TEST.dbo.person。 last_name“无法绑定”。

如何解决这个问题?

尝试这个:

 insert into [ULGP_CARES TEST].[dbo].[person](date_of_birth) select [Dtest].[dbo].[ContactBase].[BirthDate] from [Dtest].[dbo].[ContactBase] join [ULGP_CARES TEST].[dbo].[person] on [ContactBase].[FirstName]=[person].[first_name] and [ContactBase].[MiddleName]=[person].[middle_name] and [ContactBase].[LastName]=[person].[last_name] 

没有在JOIN子句中包含person表,SQL并不知道它存在。

如果这没有帮助,你还应该检查以下内容:

你确定名为“ULGP_CARES TEST”的数据库存在吗? 也许它拼写或大写不同,或者空格字符实际上是下划线,反之亦然。 在同一数据库名称中使用下划线和空格是很常见的。

您确定名为“person”的表存在于名为“ULGP_CARES TEST”的数据库中吗? 也许它拼写或大写不同,或者它可能不是“dbo”模式的一部分。

你确定名为“ULGP_CARES TEST”的数据库中名为“person”的表中存在“first_name”,“middle_name”和“last_name”列吗? 也许拼写或大写不同。