Does anyone help me find the error in this create?

-3
CREATE TABLE PedidoProduto + ProdutoPedido ( 
Quantidade numeric(50),
IDproduto int,
IDpedido int,
FOREIGN KEY(IDproduto) REFERENCES Produto (IDproduto),
FOREIGN KEY(IDpedido) REFERENCES Pedido (IDpedido)
);

No error gives this:

  

Message 102, Level 15, State 1, Line 63
  Incorrect syntax next to '+'.

The PedidoProduto table is associative.

    
asked by anonymous 13.05.2018 / 22:13

1 answer

4

The error in this CREATE is that there is no + option where you are putting (as SQL Server itself is showing for you).

If you are trying to create the two tables at the same time, create 2 separate CREATES in your script, always first creating the table that will have the primary keys and then the table that will have the FK, that is, that will depend on the data from another.

    
14.05.2018 / 05:02