This is a discussion on Incorrect syntax near ',' within the SQL Server forums, part of the Microsoft SQL Server category; --> Hey all I need help to fix this problem. I run a query like this: INSERT INTO [RDI_Test.Deleted].dbo.[Nominee]([Given Name],[Surname], ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hey all I need help to fix this problem. I run a query like this: INSERT INTO [RDI_Test.Deleted].dbo.[Nominee]([Given Name],[Surname], [OwnerID],[TitleID]) SELECT ([Given Name],[Surname],[OwnerID], [TitleID]) FROM #Temp_Deleted and got this error: Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ','. Can anyone point out the problem? Thank you. |
| |||
| There is no need to use parenthesis for the columns in the select list: INSERT INTO [RDI_Test.Deleted].dbo.[Nominee]( [Given Name], [Surname], [OwnerID], [TitleID]) SELECT [Given Name], [Surname], [OwnerID], [TitleID] FROM #Temp_Deleted; -- Plamen Ratchev http://www.SQLStudio.com |
| Thread Tools | |
| Display Modes | |
|
|
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Incorrect syntax near the keyword 'WHERE'. | DaveF | SQL Server | 1 | 03-01-2008 02:40 PM |
| Line 1: Incorrect syntax near | Sandesh | SQL Server | 1 | 02-29-2008 08:35 PM |
| Line 1: Incorrect syntax near '=' | Assimalyst | SQL Server | 3 | 02-29-2008 09:38 AM |
| A story of incorrect syntax | theintrepidfox@hotmail.com | SQL Server | 4 | 02-29-2008 07:15 AM |
| Incorrect Syntax | GitarJake | SQL Server | 5 | 02-29-2008 04:41 AM |