Inconsistent Float Formatting Between go-sqlcmd and ODBC SQLCMD Versions
I maintainer di solito rispondono entro 1 giorno
@dlevy-msft-sql ci sta già lavorando.
Dal 31/1/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Description
In Windows OS the go-sqlcmd application produces a different output format for FLOAT data types compared to the ODBC-based SQLCMD.EXE when executing the same SQL query. This discrepancy can cause issues for applications and scripts that rely on consistent float formatting.
Steps to Reproduce
- Create the following table:
CREATE TABLE [dbo].[Point](
[PointId] [int] NOT NULL,
[SessionId] [int] NULL,
[Longitude] [float] NOT NULL,
[Latitude] [float] NOT NULL,
CONSTRAINT [PK_Point] PRIMARY KEY CLUSTERED
(
[PointId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO [dbo].[Point] ([PointId], [SessionId], [Longitude], [Latitude]) VALUES
(1, 3, 788991.19988463481, 4713347.3103808956),
(2, 3, 789288.40771771886, 4712632.075629076),
(3, 3, 788569.36558582436, 4714608.0418091472);
GO
- Execute the following query using go-sqlcmd (version
1.8.1):
sqlCmd.exe -S serverName -d dbname -U username -P password -Q "SELECT TOP 10 * FROM dbo.Point" -s";" -W
- Execute the same query using the ODBC SQLCMD (version
15.0.4410):
sqlCmd.exe -S serverName -d dbname -U username -P password -Q "SELECT TOP 10 * FROM dbo.Point" -s";" -W
Observed Behavior
go-sqlcmd Output:
PointId;SessionId;Longitude;Latitude
-------;---------;---------;--------
1;3;788991.1998846348;4.713347310380896e+06
2;3;789288.4077177189;4.712632075629076e+06
3;3;788569.3655858244;4.714608041809147e+06
ODBC SQLCMD Output:
PointId;SessionId;Longitude;Latitude
-------;---------;---------;--------
1;3;788991.19988463481;4713347.3103808956
2;3;789288.40771771886;4712632.075629076
3;3;788569.36558582436;4714608.0418091472
Expected Behavior
The float formatting in the output of go-sqlcmd should align with the behavior of the ODBC SQLCMD to maintain compatibility and consistency across different SQLCMD implementations.
Environment
- go-sqlcmd version: 1.8.1
- ODBC sqlcmd version: 15.0.4410
- Database Server: SQL Server 2019, SQL Server 2022
- Operating System: Windows 11, Windows server
Additional Information
This issue primarily affects the formatting of float numbers. For example:
- In go-sqlcmd,
4.713347310380896e+06 - In ODBC sqlcmd,
4713347.3103808956
The scientific notation output from go-sqlcmd is less intuitive and might require additional parsing in downstream applications.
Request
Please investigate this behavior and consider aligning the float formatting of go-sqlcmd with the output of the ODBC-based SQLCMD.EXE.
- Lingua principale
- Go
- Stelle
- 595
- Fork
- 91
- Merge medio
- 9h 35m
- PR unite (30g)
- 1
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/go-sqlcmd
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Fix CVEs in Version v1.10.0Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/go-sqlcmd#733 · 7 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
":Help" command not workingAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/go-sqlcmd
Issue simili
-
enhancement low priority
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
eugenioenko/ttt#674 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Remove obsolete ipAllocationPolicy field from containernodepool-subnetworkref test dependencyAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
GoogleCloudPlatform/k8s-config-connector#13462 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
vavallee/bindery#2793 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno