?
Solved

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

Posted on 2016-09-21
4
Medium Priority
?
43 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 11

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 2000 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 11

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

800 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