CAST'ing a BIGINT to VarChar in Stored Procedure successfully, hhhmmm

mdlueck

Sr. Application Developer
Local time
Today, 01:34
Joined
Jun 23, 2011
Messages
2,648
I am seeing an odd thing attempting to convert a SQL Server BIGINT data type to VarChar(19) as suitable data type to be digested by Access / VBA.

In the Stored Procedure I have the following which in my mind should translate it beautifully:

Code:
SELECT CAST(@id AS varchar(19)) AS [id];
Yet I see the BigInt data type bleeding through into Access / VBA. I execute the SP with an ADO.Command object, which returns an ADO.Recordset object, I peek inside, and am very puzzled to see:

attachment.php


????? Why is this BIGINT being so stubborn? TIA!
 

Attachments

  • ADO_BigIntToVarCharConversionProblem.png
    ADO_BigIntToVarCharConversionProblem.png
    8.6 KB · Views: 2,883
Off on some other issues this week, I had forgotten that I decided to try mapping SQL Server BIGINT data type columns to Access FE table Field Size Decimal / Precision 19, and to use the Variant VBA variable type.

Last week, I found one nasty outcome of mapping BIGINT data type columns to VarChar / String in Access that the numbers do not sort numerically / properly when stored in a String column. So back through the Stored Procedures for this table again, for the moment I am going to try to get Access to be able to correctly deal with BIGINT data.
 

Users who are viewing this thread

Back
Top Bottom