How to get proper column types in Sybase

烂漫一生 提交于 2019-12-11 04:36:32

问题


I have to know the data type of some columns in my table in Sybase ASE. Here is my query

select name from systypes
where type in (39,
47,
39,
39,
106
)

this returns

char       
varchar    
sysname    
nchar      
nvarchar       
decimaln       
longsysname    

I was hoping it would return

varchar
char
varchar
varchar
decimaln

why are the results not as expected ? How can i get the proper column types ? I intend to use this information later to create a dynamic query that creates another table.


回答1:


You need to join systypes to syscolumns on both the type and usertype columns.



来源:https://stackoverflow.com/questions/27567890/how-to-get-proper-column-types-in-sybase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!