Issues with getting uniqueidentifier auto generate in SQL on insert
问题 I am trying to insert data from one table into another table. Table1 doesn't have a uniqueidentifier, but Table2 does. I have tried to insert using NEWID() , but I get a syntax error. Can someone please tell me what I am doing wrong? INSERT INTO Table2 (NEWID(), [Item Description], [Item Cost]) SELECT Description, Cost FROM Table1 WHERE Id = '1' 回答1: In case Table2 is not yet created you can use this query: SELECT NEWID() AS [ID] ,Description AS [Item Description] ,Cost AS [Item Cost] INTO