Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kpgraci
Yak Posting Veteran
68 Posts |
Posted - 2012-05-22 : 11:33:58
|
I have a source table that looks like this:DefaultCoverage LOB INT Coverage VarChar Scope INTDestination Table:PolicyCoverage SN Varchar PID INT Coverage VarChar Limit VarChar Premium MONEY Scope INTThe query is:INSERT INTO PolicyCoverage SN, PID, Coverage, Scope SELECT 'LA2007' AS SN, 29 AS PID, Coverage, Scope FROM DefaultCoverages WHERE LOB=7 I get a systax error near SNWhat am I doing wrong?kpg |
|
kpgraci
Yak Posting Veteran
68 Posts |
Posted - 2012-05-22 : 11:39:18
|
I figured it out, need to add parens else it thinks that SN is a aliais for the table.INSERT INTO PolicyCoverage (SN, PID, Coverage, Scope) SELECT 'LA2007' AS SN, 29 AS PID, Coverage, Scope FROM DefaultCoverages WHERE LOB=7 kpg |
 |
|
|
|
|