代码如下:
INSERT INTO [ExamV2.0].[dbo].[GSys_Doctors]
([CD_SerialCode]
,[CD_DoctorName]
,[CD_Gender]
,[CD_JobTitle]
,[CD_SeniorityCode]
,[CD_PracticeCode]
,[CD_MedicCode]
,[CD_IndentityCode]
,[CD_CatalogCode]
,[CD_State])
VALUES
[cmda_drems].[dbo].[GSys_Doctors]
([CD_SerialCode]
,[CD_DoctorName]
,[CD_Gender]
,[CD_JobTitle]
, '1111111'
,'1111111'
,[CD_MedicCode]
,[CD_IndentityCode]
,[CD_MedicSort]
,'1')
GO
INSERT INTO [ExamV2.0].[dbo].[GSys_Doctors]
([CD_SerialCode]
,[CD_DoctorName]
,[CD_Gender]
,[CD_JobTitle]
,[CD_SeniorityCode]
,[CD_PracticeCode]
,[CD_MedicCode]
,[CD_IndentityCode]
,[CD_CatalogCode]
,[CD_State])
VALUES
[cmda_drems].[dbo].[GSys_Doctors]
([CD_SerialCode]
,[CD_DoctorName]
,[CD_Gender]
,[CD_JobTitle]
, '1111111'
,'1111111'
,[CD_MedicCode]
,[CD_IndentityCode]
,[CD_MedicSort]
,'1')
GO
我怎么看着很别扭呢values后面应该是给值,你那怎么看起来还是字段名字
( [CD_SerialCode] ,
[CD_DoctorName] ,
[CD_Gender] ,
[CD_JobTitle] ,
[CD_SeniorityCode] ,
[CD_PracticeCode] ,
[CD_MedicCode] ,
[CD_IndentityCode] ,
[CD_CatalogCode] ,
[CD_State]
)
VALUES ( [CD_SerialCode] ,
[CD_DoctorName] ,
[CD_Gender] ,
[CD_JobTitle] ,
'1111111' ,
'1111111' ,
[CD_MedicCode] ,
[CD_IndentityCode] ,
[CD_MedicSort] ,
'1'
)
不好意思,一直很忙,刚想看到,这个Values插入的是另外一个库的表值,难道不写另一个库名和表名吗
( [CD_SerialCode] ,
[CD_DoctorName] ,
[CD_Gender] ,
[CD_JobTitle] ,
[CD_SeniorityCode] ,
[CD_PracticeCode] ,
[CD_MedicCode] ,
[CD_IndentityCode] ,
[CD_CatalogCode] ,
[CD_State]
)
select [CD_SerialCode] ,
[CD_DoctorName] ,
[CD_Gender] ,
[CD_JobTitle] ,
'1111111' ,
'1111111' ,
[CD_MedicCode] ,
[CD_IndentityCode] ,
[CD_MedicSort] ,
'1'
from [cmda_drems].[dbo].[GSys_Doctors]
([CD_SerialCode]
,[CD_DoctorName]
,[CD_Gender]
,[CD_JobTitle]
,[CD_SeniorityCode]
,[CD_PracticeCode]
,[CD_MedicCode]
,[CD_IndentityCode]
,[CD_CatalogCode]
,[CD_State])
select [CD_SerialCode]
,[CD_DoctorName]
,[CD_Gender]
,[CD_JobTitle]
,'1111111'
,'1111111'
,[CD_MedicCode]
,[CD_IndentityCode]
,[CD_MedicSort]
,'1'
from [cmda_drems].[dbo].[GSys_Doctors]