由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - SQL Server - how to obtain data type name
相关主题
初级问题请教SQL Server简单问题,DB->txt file?
ask for help with a simple query!!!SQL Server table variable 的一个问题请教。
how to get the product for a column问个external table field definition的问题
请教SQL菜鸟急问ORACLE里FUNCTION返回ref cursor的问题
请教SQL server的一个programming的问题,谢谢open cursor for collection?
How to merge tables in SQL Server 2000?请教sql server 2005,怎样在固定时间run stores procedure
2 SQL SERVER Sr SQL Programmer positions (转载)请问 sql server Script 执行的问题
Re: 刚电面一个,fail了 (转载)谁能帮我看看这个oracle function有什么错?
相关话题的讨论汇总
话题: type话题: sql话题: name话题: data话题: server
进入Database版参与讨论
1 (共1页)
y****9
发帖数: 144
1
the cursor returned by using sp_describe_cursor_columns has a column called:
data_type_sql which is smallint type?
How can I obtain the data type name (like: varchar2 int etc) from data_type
_sql intergers?
I guess there should be a way to do, like from object_id to get object_name.
Thanks!
B*****g
发帖数: 34098
2
sys.types?

called:
type
name.

【在 y****9 的大作中提到】
: the cursor returned by using sp_describe_cursor_columns has a column called:
: data_type_sql which is smallint type?
: How can I obtain the data type name (like: varchar2 int etc) from data_type
: _sql intergers?
: I guess there should be a way to do, like from object_id to get object_name.
: Thanks!

y****9
发帖数: 144
3

Thanks. this is a possible way.
1> select name from sys.types where system_type_id=56;
2> go
name
------------------------------------------------------------------
int
i am looking for if there is a built-in function to convert 56 to int?

【在 B*****g 的大作中提到】
: sys.types?
:
: called:
: type
: name.

i****a
发帖数: 36252
4
use the data type name directly, don't use ID.
if you are looking up what type a specific column is
SELECT t.name, c.name
FROM sys.columns c
INNER JOIN sys.types t
ON c.user_type_id = t.user_type_id
WHERE c.name = 'yourColumnName'
and are you using osql?? that's old school and hardcore...

【在 y****9 的大作中提到】
:
: Thanks. this is a possible way.
: 1> select name from sys.types where system_type_id=56;
: 2> go
: name
: ------------------------------------------------------------------
: int
: i am looking for if there is a built-in function to convert 56 to int?

y****9
发帖数: 144
5

I was using SQLCMD in SQL Server 2008.

【在 i****a 的大作中提到】
: use the data type name directly, don't use ID.
: if you are looking up what type a specific column is
: SELECT t.name, c.name
: FROM sys.columns c
: INNER JOIN sys.types t
: ON c.user_type_id = t.user_type_id
: WHERE c.name = 'yourColumnName'
: and are you using osql?? that's old school and hardcore...

1 (共1页)
进入Database版参与讨论
相关主题
谁能帮我看看这个oracle function有什么错?请教SQL server的一个programming的问题,谢谢
Question about T-SQLHow to merge tables in SQL Server 2000?
老印给我的一个Challenge2 SQL SERVER Sr SQL Programmer positions (转载)
SQL Server - delcare variable dynamicallyRe: 刚电面一个,fail了 (转载)
初级问题请教SQL Server简单问题,DB->txt file?
ask for help with a simple query!!!SQL Server table variable 的一个问题请教。
how to get the product for a column问个external table field definition的问题
请教SQL菜鸟急问ORACLE里FUNCTION返回ref cursor的问题
相关话题的讨论汇总
话题: type话题: sql话题: name话题: data话题: server