Solved

What is wrong with the following insert statement in SQL Server 2008?

Posted on 2016-09-21
4
31 Views
Last Modified: 2016-09-21
What is wrong with the following insert statement in SQL Server 2008?

tbl_CSL_ImportSV
---------------------------
field1  int
field2  varchar(5)
field3  varchar(11)
filed4  varchar(3)
filed5  varchar(6)
filed6  varchar(8)
field7  datetime
field8  numeric(19,2);
field9  varchar(13)
filed10  varchar(6)
filed11  varchar(6)

Insert into dbo.tbl_CSL_ImportSV
(985,'923','006928','233','054182','000','8/19/2016 0:00:00',1200000.00,'08/31/16','S','A38JMJ');

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ';'.
0
Comment
Question by:zimmer9
  • 2
4 Comments
 
LVL 10

Expert Comment

by:HuaMinChen
ID: 41809935
Try
Use your_schema
go

Insert into dbo.tbl_CSL_ImportSV
(985,'923','006928','233','054182','000','8/19/2016 0:00:00',1200000.00,'08/31/16','S','A38JMJ')

Open in new window

0
 
LVL 35

Accepted Solution

by:
Terry Woods earned 500 total points
ID: 41809936
I believe you're missing the word "values".

Try:
Insert into dbo.tbl_CSL_ImportSV 
values (985,'923','006928','233','054182','000','8/19/2016 0:00:00',1200000.00,'08/31/16','S','A38JMJ');

Open in new window

0
 

Author Comment

by:zimmer9
ID: 41809938
Terry you are ABSOLUTELY CORRECT. Thanks a million. You ROCK!!! You got me out of the woods.
0
 
LVL 10

Expert Comment

by:HuaMinChen
ID: 41809941
Try
Use your_schema
go

Insert into dbo.tbl_CSL_ImportSV
values (985,'923','006928','233','054182','000','8/19/2016 0:00:00',1200000.00,'08/31/16','S','A38JMJ')

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now