Solved

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

Posted on 2016-09-21
4
28 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
Comment Utility
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
Comment Utility
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
Comment Utility
Terry you are ABSOLUTELY CORRECT. Thanks a million. You ROCK!!! You got me out of the woods.
0
 
LVL 10

Expert Comment

by:HuaMinChen
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

6 Experts available now in Live!

Get 1:1 Help Now