For the OP command:
select compid,2, convert(datetime, '01/01/' + CONVERT(char(4),cal_yr) ,101) ,0, Update_dt, th1, th2, th3_pc , Update_id, Update_dt,1
from
I get this error:
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '*'.
when debugging something like this, split the long line so that you get the best line number:
select compid
,2
, convert(datetime
, '01/01/'
+ CONVERT(char(4)
,cal_yr)
,101)
,0
, Update_dt
, th1
, th2
, th3_pc
, Update_id
, Update_dt
,1
from
this now leads to:
Msg 102, Level 15, State 1, Line 16
Incorrect syntax near '*'.
which probably only from the OP does not put the whole command in the question or uses [] brackets to indicate the table name:
from [
if it is a table name.