| Author: ANIL PANDEY 05 Sep 2008 | Member Level: Diamond | Rating: Points: 3 |
hello,
u can use the following command to get the details
exec sp_help tabname
Regards Anil Pandey
|
| Author: Priya 05 Sep 2008 | Member Level: Silver | Rating: Points: 2 |
Try this code using dataset, it will display the column name and the datatype.
Dim adapter As System.Data.SqlClient.SqlDataAdapter ' set up your adapter, select-query the table you want to insert
Dim ds As DataSet adapter.Fill(ds)
Dim dt As DataColumn For Each dt In ds.Tables(0).Columns Response.Write(dt.ColumnName) Response.Write(dt.DataType.ToString() + "<br>") Next
Hope this helps
|
| Author: Lakhan Pal 05 Sep 2008 | Member Level: Gold | Rating: Points: 3 |
select column_name, data_type, character_maximum_length from information_schema.columns where table_name = 'myTable'
Try This.. This will give you the required Output
|
| Author: @@@ Hyderabadi Biryani @@@ 05 Sep 2008 | Member Level: Diamond | Rating: Points: 3 |
Hi
Check out the below query
Select COLUMN_NAME DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE From Information_Schema.Columns Where Table_Name = 'table_name'
Thanks -- Vj http://dotnetvj.blogspot.com
|
| Author: Suba Ganesh 06 Sep 2008 | Member Level: Silver | Rating: Points: 1 |
sp_help tablename
|
| Author: Suba Ganesh 06 Sep 2008 | Member Level: Silver | Rating: Points: 1 |
sue this
query
sp_help tablename
|
| Author: Ashwini Rupert 10 Sep 2008 | Member Level: Diamond | Rating: Points: 2 |
Hi,
The following query returns all the information about the database
select * from information_schema.columns
To get only the information you require
select column_name, data_type from information_schema.columns
Regards, Ashwini
|