@UniqueID error
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 18.4k
- Forks
- 3.7k
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 1
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the INSERT_QUERY and UPDATE_QUERY against Microsoft SQL Azure with Dapper 2.1.28, focusing on the @UniqueID parameter and the shown bracketed [UID] variant. Compare the reported error with the query text and verify that both operations complete with UniqueID present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100