Retrieving data from SQL Server 2008 - Float format read as char

I'm having an issue regarding to getting data from views in a database SQL Server 2008 to SAS v9.2, using ODBC (driver SQL Server Native Client 10.0), where some of the fields present in those views that are formatted with SQL Float and being read in SAS as char (more specifically $768.).

In the past this database was in a SQL Server 2000, and it was restored in SQL Server 2008. I've tried different ODBC driver as well (ODBC Driver 11 for SQL Server and SQL Server - 6.00.6002.18005).

Re: Retrieving data from SQL Server 2008 - Float format read as char

So, the problem is that float in SQL Server is interpreted as char in SAS?You are sure that the column in the table/view in SQL Server is defined as float? And this worked when it was in SQL Server 2000..? Issue:Options sastrace =',,,d' sastraceloc =saslog nostsuffix msglevel =i;prior to your SAS query and you will hopefully see what is happening behind the scenes.

Re: Retrieving data from SQL Server 2008 - Float format read as char

"You are sure that the column in the table/view in SQL Server is defined as float?" This was told to me by an element of another team who's not really the DB administrator, but i've been querying and it seems that is a NVARCHAR. Is this more accurate?

Can in be related to encoding in SAS session and encoding in SQL Server 2008?

Have ran the query: PROC SQL; connect to ODBC(DSN=MYDSN user=USER pwd=PASSWORD); select * from connection to ODBC (SELECT collation_name FROM sys.databases WHERE name = 'MYDSN ');QUIT;

Re: Retrieving data from SQL Server 2008 - Float format read as char

So if I understand you correctly, there is no issue. The column is defined as NVARCHAR in SQL Server and CHAR in SAS. Normal data type mapping. If you would like it to be FLOAT and NUMERICAL in SAS you need either to change the data type in SQLS (in a view if the DBA wishes it to change the table definition) or in SAS using the input() function.