NiallUK
NiallUK

Reputation: 107

New to SQL-Server, How do i fix msg 8169 error?

    INSERT INTO Cars (ID, FirstName, LastName, Manufacturer, Model, Year, Color, 
                      EngineSize, TransmissionType, Sold, Value)
    VALUES ('NEWID()', 'Tony', 'Shannon', 'Volkswagen', 'Polo', '2018', 'Orange',
            '1.0', 'Manual', 'false', '16000');

I am brand new to SQL Server and was wondering why i keep getting this error?

"Msg 8169, Level 16, State 2, Line 1 Conversion failed when converting from a character string to uniqueidentifier."

I have set the ID column as a uniqueidentifier but i'm not sure how to generate this?

Please be mindful that i am brand new so any help is appreciated!

Upvotes: 3

Views: 2502

Answers (1)

NiallUK
NiallUK

Reputation: 107

Remove the single quotes, i.e. NEWID(). – Felix Pamittan

Thank you! This solved my problem!

Upvotes: 1

Related Questions