sql server 2008 r2 - Msg 102, Level15, State 1, Line 16 INSERT based on SELECT -


i have looked @ various other posts error message , tried solutions. nothing seems fix problem. post pretty describes i'm trying do; want create new shop in database same fields existing shop.

this code.

insert [dbo].[elementdescriptions] ( [fieldname] , [displayname] , [required] , [datatype] , [sortorder] , [elementid] , [description] , [lookup] , [uitype] , [requiredfornew] , [requiredforreconditioned] , [requredforsecondhand] , [shopcode])     select ([fieldname]     , [displayname] , [required]     , [datatype] , [sortorder] , [elementid] , [description] , [lookup] , [uitype] , [requiredfornew] , [requiredforreconditioned] , [requredforsecondhand] , 'newshop') [dbo].[elementdescriptions] [aarshopcode] = 'oldshop' 

my error says it's near ','.

you shouldn't have parentheses around select list.

insert dbo.table(columns) select (columns) ... 

should be:

insert dbo.table(columns) select  columns  ... ---------------------------------^-------^ 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -