New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@UniqueID error #2024
Comments
Can we see how you're invoking the SQL? Including (and in particular) the parameters? I can't do much without seeing the usage. |
I wonder, in particular, whether you somehow have a |
In this example, |
Sorry I accidentally deleted previous comment. Basically
Model is the class with UniqueID field Checking the Model class maybe I found the problem: my partial class has this signature in the Telerik.Windows.Controls.GanttView.GanttTask there is another uniqueid property. So, I've my base class
my partial (with non relevant things)
and finally the GanttTask
Maybe is this the problem ? But Dapper how deep goes to add parameters ? |
All the deep. There are some ways of configuring this, but honestly: in most cases it is more pragmatic just to:
to explicitly call out the things you want. This is an interesting scenario, though. I wonder whether we could do something over in AOT-land to specify better restriction rules (in the AOT work, we have much better analysis tooling, and better ways of specifying configuration) |
I've already tested AOT with a part of our software (with good results), when do you think it might be "safe" to switch prod environment to AOT ? |
I'm going to refer to the Apache license to answer that:
If it works, great! I feel comfortable using it, as long as I have integration tests working. |
Hi,
I've a table with a field named UniqueID, but when I try to insert or update through Dapper I get an error on the variable name
It seems like it's some kind of reserved word/variable name.
I'm using Dapper version 2.1.28 with Microsoft SQL Azure
I tried to escape it with [] but no way. The @uniqueid variable is present only one time.
If I remove the UniqueID field and variable from queries, all works fine.
These are my query:
`internal static readonly string INSERT_QUERY = "INSERT INTO pro_ordine_composizione (SocietaID,OrdineID,ArticoloID,RevisioneID,ComposizioneID,LogAdded,LogUpdated,LogCanceled,LogAddedUserID,LogUpdatedUserID,LogCanceledUserID,ComponenteArticoloID,ComponenteRevisioneID,ComposizioneIDPadre,RepartoID,ComponenteID,Posizione,Quantita,Tempo,Inizio,Fine,RisorsaID,ESummary,EMilestone,DescrizioneMS,UniqueID,EFisso,TempoAlPezzo,Note,Piazzamento,UID,QuantitaOriginale) OUTPUT INSERTED.rv VALUES(@SocietaID,@OrdineID,@ArticoloID,@RevisioneID,@ComposizioneID,SYSUTCDATETIME() AT TIME ZONE 'UTC' AT TIME ZONE 'Central Europe Standard Time',@LogUpdated,@LogCanceled,@LogAddedUserID,@LogUpdatedUserID,@LogCanceledUserID,@ComponenteArticoloID,@ComponenteRevisioneID,@ComposizioneIDPadre,@RepartoID,@ComponenteID,@Posizione,@QuantITA,@Tempo,@IniZio,@fine,@RisorsaID,@esummary,@EMilestone,@DescrizioneMS,@uniqueid,@efisso,@TempoAlPezzo,@note,@Piazzamento,@uid,@QuantitaOriginale)";
internal static readonly string UPDATE_QUERY = "UPDATE pro_ordine_composizione SET SocietaID = @SocietaID,OrdineID = @OrdineID,ArticoloID = @ArticoloID,RevisioneID = @RevisioneID,ComposizioneID = @ComposizioneID,LogAdded = @LogAdded,LogUpdated = SYSUTCDATETIME() AT TIME ZONE 'UTC' AT TIME ZONE 'Central Europe Standard Time',LogCanceled = @LogCanceled,LogAddedUserID = @LogAddedUserID,LogUpdatedUserID = @LogUpdatedUserID,LogCanceledUserID = @LogCanceledUserID,ComponenteArticoloID = @ComponenteArticoloID,ComponenteRevisioneID = @ComponenteRevisioneID,ComposizioneIDPadre = @ComposizioneIDPadre,RepartoID = @RepartoID,ComponenteID = @ComponenteID,Posizione = @Posizione,Quantita = @QuantITA,Tempo = @Tempo,Inizio = @IniZio,Fine = @fine,RisorsaID = @RisorsaID,ESummary = @esummary,EMilestone = @EMilestone,DescrizioneMS = @DescrizioneMS,UniqueID = @uniqueid,EFisso = @efisso,TempoAlPezzo = @TempoAlPezzo,Note = @note,Piazzamento = @Piazzamento,[UID] = @uid,QuantitaOriginale = @QuantitaOriginale OUTPUT INSERTED.rv WHERE SocietaID = @SocietaID AND OrdineID = @OrdineID AND ArticoloID = @ArticoloID AND RevisioneID = @RevisioneID AND ComposizioneID = @ComposizioneID AND rv = @rv";`
Regards
The text was updated successfully, but these errors were encountered: