Drop record with ID 0

Drop record with ID 0

Hey guys,

Because of sloppy coding I have three records of an entity where the ID is 0. This shouldn't be so bad, given that it's a test environment, but for practice I tried to delete it with a SQL statement. However, I always get an error that says the key can't be null. Does anyone know how to delete a row with ID 0? 

Many thanks in advance,
You should be able to do this.  I did a quick test and it seemed to work.

In the eSpace where the entity is declared create an action.  In that action create an advanced query.  In the advanced query, use the following syntax.

delete from {<EntityName>} where {<EntityName>}.[Id] = 0
Be sure to replace <EntityName> with the actual entity being affected.  Create a structure called SQLResult with just one integer entity.  Use this structure as the output structure for the advanced query.  Click the Test button and the query should run, deleting the records with ID = 0.  

Hope this helps,

That's what I tried, except that I also added a select {Entity}.* as first line. I later noticed I could just use my Delete action to delete them manually after putting a Delete rule on Delete instead of Protect. Thanks for the help, I'm definitely coming back to this post in the future :) 
delete from {<EntityName>} where {<EntityName>}.[Id] = 0

You will get an error, but it will be deleted.