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 |
|
smitha
Posting Yak Master
100 Posts |
Posted - 2010-01-04 : 01:01:28
|
| hi,using the below code I am able to get the tag names of a table.Select namefrom sys columnswhere (object_id = OBJECT_ID(TABLENAME))Using this I am lisitng the tag names in a list box. now if I want the values along with the tag names, how to go about it? Please help me.Smitha |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-01-04 : 01:49:18
|
isn't that just a SELECT <COLUMN NAME> FROM <TABLE NAME>SELECT *FROM TABLENAME KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-01-04 : 01:55:25
|
| <<Using this I am lisitng the tag names in a list box. now if I want the values along with the tag names>>What do you mean by a vlaue?MadhivananFailing to plan is Planning to fail |
 |
|
|
smitha
Posting Yak Master
100 Posts |
Posted - 2010-01-04 : 03:00:00
|
| I am using a Trends in an application and sql as database.Now using the above code I am able to retrieve the tag names from the database and put it in the list box in the application.Now in the application, if I choose any tag name from the list box, for that tag name it has to show the values in the trend.Smitha |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-01-04 : 03:36:49
|
| then you might need to pass selected tag name as a parameter to a dynamic query as followsSET @SQL='SELECT ' + @YourSelectedTag + ' FROM YourTable'EXEC(@Sql) |
 |
|
|
smitha
Posting Yak Master
100 Posts |
Posted - 2010-01-04 : 06:23:02
|
Sorry, I couldn't get anythingquote: Originally posted by visakh16 then you might need to pass selected tag name as a parameter to a dynamic query as followsSET @SQL='SELECT ' + @YourSelectedTag + ' FROM YourTable'EXEC(@Sql)
Smitha |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-01-04 : 07:23:16
|
quote: Originally posted by smitha Sorry, I couldn't get anythingquote: Originally posted by visakh16 then you might need to pass selected tag name as a parameter to a dynamic query as followsSET @SQL='SELECT ' + @YourSelectedTag + ' FROM YourTable'EXEC(@Sql)
Smitha
Read thiswww.sommarksog.se/dynamic_sql.htmlMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|