使用下面的代码将“tablename”中的内容转换为“result”。这导致如下所示的错误。当我双击错误中的逗号时,它在acct和run之间的第二行中的逗号下方有一条红线,然后是第二行的右括号。首先,这是否告诉我整个第二行存在缺陷?
Msg 102, Level 15, State 1, Line 2
','附近的语法不正确。
Insert into dbo.result(account,unit,name1,name2,address1,address2,city,st,zip,zipext,addressty,latitude,longitude,telephone,employment,ownership,naicscode,pluscode)
Select (acct,run,legalname,busname,pladdr1,pladdr2,plcity,plstate,plzip,plzipx,moaddtype,latitude,longitude,phonenum,employment,own,naics,plus)
From dbo.tablename
答案 0 :(得分:1)
略过额外的括号:
Insert into dbo.result(account, unit, name1, name2, address1, address2, city,
st, zip, zipext,addressty, latitude, longitude,
telephone, employment, ownership, naicscode, pluscode)
Select acct, run, legalname, busname, pladdr1, pladdr2, plcity,
plstate, plzip, plzipx, moaddtype, latitude, longitude,
phonenum, employment, own, naics, plus
From dbo.tablename