代码如下:
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

解决方案 »

  1.   


    我怎么看着很别扭呢values后面应该是给值,你那怎么看起来还是字段名字
      

  2.   

    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  ( [CD_SerialCode] ,
              [CD_DoctorName] ,
              [CD_Gender] ,
              [CD_JobTitle] ,
              '1111111' ,
              '1111111' ,
              [CD_MedicCode] ,
              [CD_IndentityCode] ,
              [CD_MedicSort] ,
              '1'
            )
      

  3.   


    不好意思,一直很忙,刚想看到,这个Values插入的是另外一个库的表值,难道不写另一个库名和表名吗
      

  4.   

    那就要改成这样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] 
            ) 
    select  [CD_SerialCode] , 
              [CD_DoctorName] , 
              [CD_Gender] , 
              [CD_JobTitle] , 
              '1111111' , 
              '1111111' , 
              [CD_MedicCode] , 
              [CD_IndentityCode] , 
              [CD_MedicSort] , 
              '1'
    from  [cmda_drems].[dbo].[GSys_Doctors]        
      

  5.   

    try this,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])
    select [CD_SerialCode]
           ,[CD_DoctorName]
           ,[CD_Gender]
           ,[CD_JobTitle]
           ,'1111111'
           ,'1111111'
           ,[CD_MedicCode]
           ,[CD_IndentityCode]           
           ,[CD_MedicSort] 
           ,'1'
    from [cmda_drems].[dbo].[GSys_Doctors]