小编use*_*021的帖子

将多个值插入临时表SQL Server

我正在使用Microsoft SQL Server Management Studio,我正在尝试运行以下查询以将值输入到临时表中以供以后使用:

CREATE TABLE #temptable
(colnumber varchar(15), dispcode varchar(10))

INSERT INTO #temptable (colnumber, dispcode)
VALUES 
('col5', '811'),
('col6', '817'),
('col7', '823'),
('col8', '825');
Run Code Online (Sandbox Code Playgroud)

运行时我收到以下错误:

消息102,级别15,状态1,行50
','附近的语法不正确.

哪个指向"('col5','811'),"

谁能帮我在这里找出问题所在?

sql-server ssms temp-tables

4
推荐指数
1
解决办法
6万
查看次数

标签 统计

sql-server ×1

ssms ×1

temp-tables ×1