I want to insert guid values into an existing column called rowguid
in an existing table.
I've created the column with this statement:
ALTER TABLE [myschema].[mytablename]
ADD rowguid uniqueidentifier
The column has been created and it's full of NULL
s.
I've tried this to generate the IDs for every row:
INSERT INTO [myschema].[mytablename] (rowguid)
VALUES(NEWID())
But this returns with:
Cannot insert the value NULL into column '[another column name in my table]', table '[database].[schema].[mytablename]'; column does not allow nulls. INSERT fails. The statement has been terminated.