Insert in SQL fields not null

0

Hi, I have the following question. It's something very basic but now it has me stranded. I want to make a query to a table from sql server managment. The problem is that I have the Id that turns out to be primary key, not null and it is self-increasing. This would mean that I can not insert a data directly and that it should "auto increment", but when I do the query it simply tells me that I can not leave the Id field as null. So far I have tried to do the query without inculiring the Id field but it does not allow it, nor does it allow me to put a value in the query or declare the value as Null. Any idea what I'm doing wrong?
Here is the general information


Finally, if you do not see it here, I leave you my query, where I am despising Id

INSERT INTO [DB_PCC].[dbo].[Requests]
           ([Wiw],[UserId],[Project],[SchemeId],[Status],
           [ExpirationDays],[Comments],[DepartmentId]
           ,[CategoryId],[seen],[Light],[Edit],[CreateDate],
           [SeenDate],[SendDate],[AnswerDate]
           ,[EditDate],[Sent],[Approved],[Rejected])
     VALUES
          ('x',3333,'testxxx',2,'En espera',3,'none'
			      ,2 ,4,0,1,0,'none' ,'none'
            ,'none' ,'none','none',0,0,0)
GO
    
asked by E.Rawrdríguez.Ophanim 18.10.2017 в 21:30
source

1 answer

1

You should copy the Query to create the table to see how you are declaring the primary key and whether or not it is autoincrementable. On the other hand when inserting a new ID value into the table and this is repeated, it gives you the error you propose.

    
answered by 18.10.2017 / 22:47
source