Hey Everyone,
I'm working with air travel data stored in SQL Server. One of the tables, called "FLEET" identifies various attributes of different airline's fleet (e.g. aircraft model and series, engine model, etc.). the "OPERATOR" column identifies the carrier (e.g. "UNITED AIRLINES", "AMERICAN AIRLINES", etc.). [Side note: everything in the database is stored in all caps, hence the way I'm typing it]. In terms of character length, no OPERATOR exceeds 45 characters (including spaces), so I am not encountering long string limitations.
When using the Code:
or the Code:
each observation in the OPERATOR column is truncated to five characters with extra nonstandard characters after the fifth. For example, AMERICAN AIRLINES appears as AMERI\0\0\0\0Žï® in some instances (but not in all instances). The only airlines that are not truncated are those that have five or fewer characters. I doubt this matters, but many (although not all) of the nonstandard instances involve the Žï® characters in that order (although there are some that do not have any of those characters).
If I enter the SQL command found in Code 2 directly into SQL Server Management Studio, I do not see any truncation at all. Also, there is another table that contains some of the same airlines (but not all of the same airlines), that table does not experience this error. It is just the OPERATOR column of the FLEET table that experiences this error. [I realize that this indicates that my database does not follow standard normalization principles. Unfortunately I did not create the database and do not have the authority to change it].
I need to perform operations on the data in the FLEET table, which means I must have the correct OPERATOR data. I'm not sure how to accomplish that, so I would appreciate any advice on the matter.
Final Notes (maybe they'll mean more to you than to me):
Operating System: Windows 7 Enterprise
Stata Version: IC 13.1 64-bit
SQL Server Management Studio Version: 11.0.5343.0
SQL Server 2012
ODBC Data Source Administrator Driver: SQL Server Native Client 10.0 Version 2009.100.4042.00
Thank you,
Andrew
I'm working with air travel data stored in SQL Server. One of the tables, called "FLEET" identifies various attributes of different airline's fleet (e.g. aircraft model and series, engine model, etc.). the "OPERATOR" column identifies the carrier (e.g. "UNITED AIRLINES", "AMERICAN AIRLINES", etc.). [Side note: everything in the database is stored in all caps, hence the way I'm typing it]. In terms of character length, no OPERATOR exceeds 45 characters (including spaces), so I am not encountering long string limitations.
When using the Code:
Code:
odbc load, table("FLEET") dsn("DSNNAME")
Code:
odbc load, exec("SELECT * FROM FLEET") dsn("DSNNAME")
If I enter the SQL command found in Code 2 directly into SQL Server Management Studio, I do not see any truncation at all. Also, there is another table that contains some of the same airlines (but not all of the same airlines), that table does not experience this error. It is just the OPERATOR column of the FLEET table that experiences this error. [I realize that this indicates that my database does not follow standard normalization principles. Unfortunately I did not create the database and do not have the authority to change it].
I need to perform operations on the data in the FLEET table, which means I must have the correct OPERATOR data. I'm not sure how to accomplish that, so I would appreciate any advice on the matter.
Final Notes (maybe they'll mean more to you than to me):
Operating System: Windows 7 Enterprise
Stata Version: IC 13.1 64-bit
SQL Server Management Studio Version: 11.0.5343.0
SQL Server 2012
ODBC Data Source Administrator Driver: SQL Server Native Client 10.0 Version 2009.100.4042.00
Thank you,
Andrew
Comment