Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jpradeep
Starting Member
8 Posts |
Posted - 2006-09-29 : 00:12:35
|
| Hi AllHow can I fetch particular field/column datatype in a table using sql query?Database is SQLServer 2000for eg. Table 'tInfo' contains one column 'Distance'. I want to know whether column 'Distance' is 'int' or 'double'. According to that I have to write function in visual basic 6.0Thanks in advance |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-29 : 00:24:24
|
| select * from information_schema.columnsjust add WHERE's as needed.Peter LarssonHelsingborg, Sweden |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-09-29 : 00:27:59
|
| [code]select DATA_TYPEfrom INFORMATION_SCHEMA.COLUMNSwhere TABLE_NAME = 'tInfo' and COLUMN_NAME = 'Distance'[/code]CODO ERGO SUM |
 |
|
|
jpradeep
Starting Member
8 Posts |
Posted - 2006-09-29 : 06:50:20
|
| Working great.ThanQ very much. |
 |
|
|
|
|
|