为什么在表中一次插入多行时','附近的语法不正确? [英] why incorrect syntax near ',' when inserting multiple rows at a time in a table?

查看:52
本文介绍了为什么在表中一次插入多行时','附近的语法不正确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在研究SQL 2008数据库。在Micosoft SQL服务器管理工​​作室中,我试图在表中一次插入多个记录,使用此查询

Hi,

I am working on SQL 2008 database. In Micosoft SQL server Management studio, i am trying to insert multiple records at a time in a table, using this query

展开 | 选择 | 换行 | 行号

推荐答案

即使使用固定值也可以使用SELECT ...尝试类似的事情:

You can use a SELECT even with fixed value...Try something like:

展开 | Sel ect | Wrap | 行号


您好,


代码工作正常,你告诉我试试。这对我也很有帮助。谢谢。你能告诉我吗 ?为什么我的代码不起作用?
Hi,

The code is working finely, which you told to try me. This also very helpful for me. Thanks. Can you tell me ? why my code is not working ?


非常简单,当插入文字值时,你一次只能插入1行。


作为language允许您插入查询结果,您可以使用union查询生成包含多行文字的结果集
Very simply, when inserting literal values, you may only insert 1 row at a time.

As the language allows you insert the result of a query, you can use a union query to generate a result set containing multiple rows of literals


这篇关于为什么在表中一次插入多行时','附近的语法不正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆