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...
|