Sql 如何创建一个自动生成表并自动填充值的过程

Sql 如何创建一个自动生成表并自动填充值的过程,sql,sql-server,procedure,Sql,Sql Server,Procedure,,没有过程的代码是: CREATE TABLE PLATOS(Idplatos integer PRIMARY KEY, Tipo varchar(20), PlatoP varchar(20)); ---insert--- INSERT INTO Platos VALUES('1','entrada','ceviche'); INSERT INTO Platos VALUES('2','entrada','arrozleche'); INSERT INTO Platos VALUES('3',

,没有过程的代码是:

CREATE TABLE PLATOS(Idplatos integer PRIMARY KEY, Tipo varchar(20), PlatoP varchar(20));
---insert---
INSERT INTO Platos VALUES('1','entrada','ceviche');
INSERT INTO Platos VALUES('2','entrada','arrozleche');
INSERT INTO Platos VALUES('3','sopa','caldo');
INSERT INTO Platos VALUES('4','sopa','mote');
INSERT INTO Platos VALUES('5','plato','lomo');
INSERT INTO Platos VALUES('6','plato','rusa');
(代码的完整尝试-这是第一次) 我怎样才能做到这一点?现在,我只能自动生成一个表,但是如果没有4位整数,则无法插入值,因为sql server会这样说

EXECUTE(
    'Select TOP 1' + @xEntrada + '=' +@PlatoP+ 'from' +@Platos+ 'where' +@tipo+ '=' +@A+@entrada1+@A+ 'ORDER BY NEWID()
    Select TOP 1' + @xSopa + '=' +@PlatoP+ 'from' +@Platos+ 'where' +@tipo+ '=' +@A+@sopa1+@A+ 'ORDER BY NEWID()
    Select TOP 1' + @xPlato + '=' +@PlatoP+ 'from' +@Platos+ 'where' +@tipo+ '=' +@A+@plato1+@A+ 'ORDER BY NEWID()
    if (not exists(select 1 FROM'+@NOMBRE_TABLA+ 'WHERE' +@entrada1+ '=' +@xEntrada+ 'AND' +@Sopa1+ '=' +@xSopa+ 'AND'
+@PLATO1+ '=' +@xPlato+ '))' + 'BEGIN INSERT INTO' +@NOMBRE_TABLA+ 'values (' +@nd+ ',' +@xEntrada+ ',' +@xSopa+ ','
+@xPlato+ ')' + 'SET' +@nd+ '=' +@nd+ '+1' + 'END END;')

还有很多,但他们说的几乎一样,我想差不多有115次了。

我遗漏了什么吗?怎么样

> Msg 102, Level 15, State 1, Line 123 Incorrect syntax near '='. Msg
> 102, Level 15, State 1, Line 124 Incorrect syntax near '='. Msg 102,
> Level 15, State 1, Line 125 Incorrect syntax near '='. Msg 102, Level
> 15, State 1, Line 126 Incorrect syntax near '='. Msg 102, Level 15,
> State 1, Line 126 Incorrect syntax near ','. Msg 102, Level 15, State
> 1, Line 123 Incorrect syntax near '='. Msg 102, Level 15, State 1,
> Line 124 Incorrect syntax near '='. Msg 102, Level 15, State 1, Line
> 125 Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='.
或者,如果表创建正常,并且已手动插入第一行,请使用插入选择:

select * into newtable from platos;

这需要动态SQL。还有很多例子。另外,删除MySQL标记,这看起来完全像SQL Server。尝试打印整个语句。应该可以很容易地发现问题。此外,您可能需要添加一些空格。最后,除非这是一个学生项目,否则重新考虑你的方法。你不应该动态创建表。是的,这是一个学生的项目。我将尝试复制整个语句,我认为115太多了(sqlserver现在崩溃是因为另一个原因)
> Msg 102, Level 15, State 1, Line 123 Incorrect syntax near '='. Msg
> 102, Level 15, State 1, Line 124 Incorrect syntax near '='. Msg 102,
> Level 15, State 1, Line 125 Incorrect syntax near '='. Msg 102, Level
> 15, State 1, Line 126 Incorrect syntax near '='. Msg 102, Level 15,
> State 1, Line 126 Incorrect syntax near ','. Msg 102, Level 15, State
> 1, Line 123 Incorrect syntax near '='. Msg 102, Level 15, State 1,
> Line 124 Incorrect syntax near '='. Msg 102, Level 15, State 1, Line
> 125 Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 125
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 126
> Incorrect syntax near ','. Msg 102, Level 15, State 1, Line 123
> Incorrect syntax near '='. Msg 102, Level 15, State 1, Line 124
> Incorrect syntax near '='.
select * into newtable from platos;
insert into newtable (col1, col2, col3, col4) 
select cola, colb, colc, cold from oldtable;