简体   繁体   English

简单的INSERT语句出错

[英]Error with simple INSERT statement

I made an insert statement that runs inside a asp.net page. 我做了一个插入语句,该语句在asp.net页内运行。 It gave me an error, so I went to the sql server and ran the statement as it should be and used it to compare with what I wrote in the asp.net page. 它给了我一个错误,所以我去了sql server并按原样运行了该语句,并使用它与我在asp.net页中编写的内容进行了比较。 The thing is, it it writen properly but it doesn't work. 关键是,它编写正确,但是不起作用。 It can't seem to detect the database or the tables at all and tells me the table doesn't exist and neither do the colums. 它似乎根本无法检测到数据库或表,并告诉我该表不存在,列也不存在。 The statement looks like this: 该语句如下所示:

INSERT [Remisiones].[dbo].[Places] (Name, Type) VALUES ("Planta 1", "Planta")

I have also tried using [dbo].[Places] and simply Places but it gives me an error at the place of the table saying it is an Invalid object name . 我也尝试过使用[dbo].[Places]和简单的Places但是在表的位置给我一个错误,说它是一个Invalid object name What is it doing? 到底在做什么

Don't use double quotes for string delimiters; 不要对字符串定界符使用双引号; use single quotes. 使用单引号。

INSERT [Remisiones].[dbo].[Places] (Name, Type) VALUES ('Planta 1', 'Planta');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM