Click here to Skip to main content
15,886,622 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SQL result set is not match with asp.net, but I can't able to find the mismatch datatype, can you help me to find it.

I want to know the data type with SQL result.
Posted
Comments
virang_21 9-Feb-15 0:13am    
Please post part of the source code that is causing issue.
[no name] 9-Feb-15 0:16am    
I want to know the datatype from the SQL query result set.

1 solution

Why don't you check manually the datatypes of the columns those are present in the select list? That would be the simplest way to do this.
I don't think there is any direct way to know the datatype of the columns in the result. But you can find the datatype of columns a table by following query
SQL
SELECT Col.NAME [COL NAME],Typ.NAME [DATA TYPE]
FROM SYS.COLUMNS Col
INNER JOIN SYS.TYPES Typ ON Col.USER_TYPE_ID = Typ.USER_TYPE_ID
WHERE Col.OBJECT_ID = OBJECT_ID('YourTableName')


Hope, it helps :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900