?
Solved

inserting date in datetime column

Posted on 2005-04-26
1
Medium Priority
?
261 Views
Last Modified: 2010-03-19
Hi:

I am inserting date in datetime column and getting error message.
message is - Syntax error converting datetime from character string.

insert into table1
Values (0,0,'0','0','0','0','0','0','0','0','5/1/2004','0','0')

Any help!
Thanks,
sripri96
0
Comment
Question by:sripri96
1 Comment
 
LVL 28

Accepted Solution

by:
rafrancisco earned 1000 total points
ID: 13870458
Make sure that the columns in Table1 matches the list in your VALUES clause.  To be safe, it's better to specify the column names in your INSERT clause to make sure that the VALUES match.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

578 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