Next I have to do a search and implement a query in the database using Merge
and I have to do this using one of the scripts used in class.
The problem is that when I run the script it gives the following error in insert
and the table ends up empty.
Orders table
CREATE TABLE pedido (nr_pedido numeric(5) NOT NULL,
dt_pedido date, nr_mesa numeric(4));
Insert
INSERT INTO pedido VALUES (1, GETDATE(), 527),
(2, '10/10/2009', 632),
(3, '21/05/2009', 606),
(4, '26/06/2009', 970),
(5, '05/05/2009', 606),
(6, '13/11/2009', 527),
(7, '01/03/2005', 181),
(8, '09/04/2010', 181);
After running the insert the following error message appears:
Msg 242, Level 16, State 3, Line 67 The conversion of a varchar data type to a date-time result in an out-of-range value. The statement has been terminated.