[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQL syntax error

Posted on 2009-12-21
5
Medium Priority
?
240 Views
Last Modified: 2013-11-26
Hi, can anyone please tell me what is wrong here:

insert into CommEmailHeader
(
       CommEmailHeaderNbr, AsSoonAsPossibleYN, DateToSend,
       EMailAddress,EMailSubject,EMailMessage, DeleteAfterSendYN,
       PGPEncryptYN, AuditYN, SentYN, SendDate, EmailCreateDate, Cell3FirstDigit, PersonRef
)

I get an error message: Line 8: Incorrect syntax near ')'.
0
Comment
Question by:NerishaB
5 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 336 total points
ID: 26094536
you are missing the VALUES part, resp. the SELECT to specify which values to actually insert...
0
 
LVL 8

Assisted Solution

by:isaackhazi
isaackhazi earned 332 total points
ID: 26094537
Im sorry but i dont follow your syntax...

The syntax for inserting is

INSERT INTO tblName(column1,column2,column3.......) VALUES (value1,value2,value3....)


In the baove query column1 correspons to value1........
0
 
LVL 8

Expert Comment

by:isaackhazi
ID: 26094542
So if I have a table

ID     NAME       Address      Email


I would insert as such:


INSERT INTO tblname(ID,NAME,Address,Email) Values(1,'Isaac','Addres # 123 steert','isaac@hotmail.com')
0
 
LVL 4

Assisted Solution

by:apexpert
apexpert earned 332 total points
ID: 26094571
Please follow this
Insert into TableName (column name1,column name2,column name3,..........n)
values (Value1, Value2, Value3 ,..........n)


insert into CommEmailHeader
(
       CommEmailHeaderNbr, AsSoonAsPossibleYN, DateToSend,
       EMailAddress,EMailSubject,EMailMessage, DeleteAfterSendYN,
       PGPEncryptYN, AuditYN, SentYN, SendDate, EmailCreateDate, Cell3FirstDigit, PersonRef
)
values (Value1, Value2, Value3 ,..........n)
0
 

Author Closing Comment

by:NerishaB
ID: 31668458
Thanks
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question