从一个表插入表到另一个表错误引发时 [英] when insert a table from one table to another table error raising

查看:79
本文介绍了从一个表插入表到另一个表错误引发时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

INSERT INTO dbo.CollegeDetails (CollegeAutoID,CollegeCode,CollegeName,CollegeType,InstitutionType,Address,Pincode,Location,District,AffiliatedUniversity,EstablishedYear,IsActive,AddedBy,AddedOn,CollegeCategoryAutoID,WebAddress,CollegeNameID)
SELECT (CollegeAutoID,CollegeCode,CollegeName,CollegeType,InstitutionType,Address,Pincode,Location,District,AffiliatedUniversity,EstablishedYear,IsActive,AddedBy,AddedOn,CollegeCategoryAutoID,WebAddress,CollegeNameID)
from dbo.MedicalCollegesDetails





错误提升:

消息102,等级15,状态1,行2

','附近的语法不正确。



Error raising:
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ','.

推荐答案

经过测试:



Tested:

INSERT INTO dbo.CollegeDetails 
(CollegeAutoID,CollegeCode,CollegeName,CollegeType,InstitutionType,Address,Pincode,Location,District,AffiliatedUniversity,EstablishedYear,IsActive,AddedBy,AddedOn,CollegeCategoryAutoID,WebAddress,CollegeNameID)
SELECT CollegeAutoID,CollegeCode,CollegeName,CollegeType,InstitutionType,Address,Pincode,Location,District,AffiliatedUniversity,EstablishedYear,IsActive,AddedBy,AddedOn,CollegeCategoryAutoID,WebAddress,CollegeNameID
from dbo.MedicalCollegesDetails


试试这个。





Try this.


INSERT INTO dbo.CollegeDetails 
SELECT (CollegeAutoID,CollegeCode,CollegeName,CollegeType,InstitutionType,Address,Pincode,Location,District,AffiliatedUniversity,EstablishedYear,IsActive,AddedBy,AddedOn,CollegeCategoryAutoID,WebAddress,CollegeNameID)
from dbo.MedicalCollegesDetails


这篇关于从一个表插入表到另一个表错误引发时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆