Question

Msg 102, Level 15, State 1, Line 3 Incorrect syntax near '13'. This was my query...

Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '13'.

This was my query code in server 18

Query 1 - INSERT INTO dbo.CustomerMaster

            (CustomerID,Name,

             EMail, Address,CardNo,CardExpiryDate)

VALUES     (1,'Raj','[email protected]', 'A-121','1222223333','12-12-23'),   (2,'Mac','[email protected]', 'A-321','9898887876’,'13-12-25'), (3,'Alex','[email protected]','B-888','7767676565’,'15-01-24')

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Error details :

  • In the given sql insert statement in line 3 before CardExpiryDate date there is ’, instead of '.
  • Same is case with line 4 before CardExpiryDate and hence showing the error.
  • Also date should be in the format of yyyy-mm-dd
  • hence below is the correct sql statement

Correct SQL insert statement :

INSERT INTO dbo.CustomerMaster
(CustomerID,Name,EMail, Address,CardNo,CardExpiryDate)
VALUES
(1,'Raj','[email protected]', 'A-121','1222223333','2012-12-23'),   
(2,'Mac','[email protected]', 'A-321','9898887876','2013-12-25'),
(3,'Alex','[email protected]','B-888','7767676565','2015-01-24')

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
Msg 102, Level 15, State 1, Line 3 Incorrect syntax near '13'. This was my query...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • /* (5) Question #2: Fix the following query. It should return     13 rows, first one is...

    /* (5) Question #2: Fix the following query. It should return     13 rows, first one is "USB food flash drive - banana" */ SELECT     SI.StockItemID,     SI.StockItemName AS [ItemForSales],     SI.ColorID AS [Color] FROM     Warehouse.StockItems SI ORDER BY     ItemForSales      WHERE     SI.ColorID = NULL     AND     SI.StockItemName LIKE '%USB%'    my error : Msg 156, Level 15, State 1, Line 12 Incorrect syntax near the keyword 'WHERE'. What is causing my error?

  • Oracle only database: DROP TABLE ORDERITEMS; DROP TABLE Orders; DROP TABLE BOOKAUTHOR; DRO...

    oracle only database: DROP TABLE ORDERITEMS; DROP TABLE Orders; DROP TABLE BOOKAUTHOR; DROP TABLE BOOKS; DROP TABLE PROMOTION; DROP TABLE AUTHOR; DROP TABLE CUSTOMERS; DROP TABLE PUBLISHER; CREATE TABLE Customers ( Customer# NUMBER(4), LastName VARCHAR2(10) NOT NULL, FirstName VARCHAR2(10) NOT NULL, Email VARCHAR(40), Address VARCHAR2(20), City VARCHAR2(12), State VARCHAR2(2), Zip VARCHAR2(5), Referred NUMBER(4), Region CHAR(2), CONSTRAINT customers_customer#_pk PRIMARY KEY(customer#) ); INSERT INTO CUSTOMERS VALUES (1001, 'MORALES', 'BONITA', '[email protected]', 'P.O. BOX 651', 'EASTPOINT', 'FL', '32328', NULL, 'SE'); INSERT INTO CUSTOMERS VALUES...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT