I keep getting an error about my comma on my insert statement. Any idea as to why this might be. Here is the error message:\[quote\] Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ','.\[/quote\]and the \[code\]INSERT INTO...SELECT\[/code\] statement\[code\]insert into custflag (cust_no, flag) select customer.cust_no from customer, dupaddr where customer.cust_no = dupaddr.cust_no, select cast(flag as int) from flag where flag_desc = 'Dup Customer'\[/code\]here is the full code of my query.\[code\]SET IDENTITY_INSERT flag ONinsert into flag (flag,flag_desc,available)values ((select Max(flag) from flag) + 1, 'Dup Customer', 1)create view dupaddr as select distinct c1.cust_no, c1.firstname, c1.lastname, c1.company, c1.predir + ' ' + c1.streetno + ' ' + c1.streetnm + ' ' + c1.suffix + ' ' + c1.postdir as fff ,c1.address2from customer c1,customer c2 where c1.cust_no <> c2.cust_noand c1.firstname = c2.firstname and c1.lastname = c2.lastname and c1.company = c2.companyand c1.predir + ' ' + c1.streetno + ' ' + c1.streetnm + ' ' + c1.suffix + ' ' + c1.postdir = c2.predir + ' ' + c2.streetno + ' ' + c2.streetnm + ' ' + c2.suffix + ' ' + c2.postdir and c1.address2 = c2.address2insert into custflag (cust_no,flag)select customer.cust_no from customer, dupaddr where customer.cust_no = dupaddr.cust_no , select cast(flag as int) from flag where flag_desc = 'Dup Customer'\[/code\]
Incorrect syntax near ','.\[/quote\]and the \[code\]INSERT INTO...SELECT\[/code\] statement\[code\]insert into custflag (cust_no, flag) select customer.cust_no from customer, dupaddr where customer.cust_no = dupaddr.cust_no, select cast(flag as int) from flag where flag_desc = 'Dup Customer'\[/code\]here is the full code of my query.\[code\]SET IDENTITY_INSERT flag ONinsert into flag (flag,flag_desc,available)values ((select Max(flag) from flag) + 1, 'Dup Customer', 1)create view dupaddr as select distinct c1.cust_no, c1.firstname, c1.lastname, c1.company, c1.predir + ' ' + c1.streetno + ' ' + c1.streetnm + ' ' + c1.suffix + ' ' + c1.postdir as fff ,c1.address2from customer c1,customer c2 where c1.cust_no <> c2.cust_noand c1.firstname = c2.firstname and c1.lastname = c2.lastname and c1.company = c2.companyand c1.predir + ' ' + c1.streetno + ' ' + c1.streetnm + ' ' + c1.suffix + ' ' + c1.postdir = c2.predir + ' ' + c2.streetno + ' ' + c2.streetnm + ' ' + c2.suffix + ' ' + c2.postdir and c1.address2 = c2.address2insert into custflag (cust_no,flag)select customer.cust_no from customer, dupaddr where customer.cust_no = dupaddr.cust_no , select cast(flag as int) from flag where flag_desc = 'Dup Customer'\[/code\]