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 |
|
ehsandar
Starting Member
4 Posts |
Posted - 2008-06-18 : 02:46:24
|
| I want to get a table column name at run time through query. Can any one help me.ehsan ulhaq dar |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-06-18 : 02:50:25
|
| What do you mean at 'run time'? Could you please explain further. |
 |
|
|
ehsandar
Starting Member
4 Posts |
Posted - 2008-06-18 : 04:59:54
|
| Actually i am working in jsp. In jsp page I got table name as a parameter and show its all column in jsp page.ehsan ulhaq dar |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-18 : 05:07:35
|
| just use this"SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME =" & YourTableNameParameter |
 |
|
|
ehsandar
Starting Member
4 Posts |
Posted - 2008-06-18 : 07:03:07
|
| I use this qry "SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = COUNTRY" in SQL Server it give "error Invalid column name 'COUNTRY'."ehsan ulhaq dar |
 |
|
|
ehsandar
Starting Member
4 Posts |
Posted - 2008-06-18 : 07:18:54
|
| I got the error cause, table name should be single colon i.e. 'COUNTRY'. Thanks visakh16 for your help. GOD bless you.ehsan ulhaq dar |
 |
|
|
|
|
|